Ansible

Creating Ansible Inventory

Example ansible inventory file used for ansible-playbook.

# Generated by Vagrant

hpc02-test ansible_host=192.168.121.124 ansible_port=22 ansible_user='vagrant' ansible_ssh_private_key_file='/home/costrouc/.vagrant.d/insecure_private_key'
hpc03-test ansible_host=192.168.121.176 ansible_port=22 ansible_user='vagrant' ansible_ssh_private_key_file='/home/costrouc/.vagrant.d/insecure_private_key'
hpc04-test ansible_host=192.168.121.133 ansible_port=22 ansible_user='vagrant' ansible_ssh_private_key_file='/home/costrouc/.vagrant.d/insecure_private_key'
hpc01-test ansible_host=192.168.121.35 ansible_port=22 ansible_user='vagrant' ansible_ssh_private_key_file='/home/costrouc/.vagrant.d/insecure_private_key'

[hpc-master]
hpc01-test

[hpc-worker]
hpc02-test
hpc03-test
hpc04-test

[partition-example]
hpc02-test
hpc04-test

This inventory can be located anywhere and we do not require all the fields. For each host we need at least the name e.g. hpc02-test and ansible_host e.g. 192.168.121.124. The rest of the fields are optional but may be needed in your case for connecting ansible with the nodes.

Additionally two groups must be specified hpc-master which is the designated master node along with hpc-worker (all) the worker nodes.

Arbitrary additional groups with name partition-<name> may be added to create additional slurm partition groups.