====== Ansible usage on GPU cluster ======
Just some instructions on how to use ansible on the GPU cluster.
For Ansible make a file `/etc/ansible/hosts` with:
[artscluster_nodes]
arts[001:040].apertif
[artscluster_master]
arts041.apertif
[artscluster:children]
artscluster_nodes
artscluster_master
De hosts file kan ook ergens anders staan, maar dan moet je ''ANSIBLE_INVENTORY=/path/to/host/file'' als envvar zetten.
* Om commando’s uit te voeren: ''ansible -a ""''
* Om met een andere username in te loggen (Default is huidige user): ''ansible -u apertif''
* Om meer processen parallel te doen (Default is 5): e.g. ''ansible -f 40''
* Om alle software te herstarten zou je dus het volgende kunnen doen:
> ansible -u apertif -f 40 artscluster_nodes -a "sudo systemctl restart arts-nodes.service"
> ansible -u apertif artscluster_master -a "sudo systemctl restart arts-survey.service"
===== Wat doet ansible als een host niet reageert? =====
* Default timeout is 10s, daarna krijg je dit:
[oostrum@hermes]~$ ansible test -a "hostname"
www.astron.nl | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host www.astron.nl port 22: Operation timed out",
"unreachable": true
}