How To Use Ansible: Difference between revisions
Jump to navigation
Jump to search
Jgutierrez6 (talk | contribs) No edit summary |
Jgutierrez6 (talk | contribs) mNo edit summary |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
Ansible is provisioning tool for bare-metal and virtual machines. | Ansible is provisioning tool for bare-metal and virtual machines. | ||
'''These commands should only be used by privileged users.''' | |||
== Warning == | |||
'''<big> These commands should only be used by privileged users. </big>''' | |||
'''<big> Do not use these instructions if you do not have patience to read them. </big>''' | |||
'''<big> One mistake can be very bad.</big>''' | |||
== Instructions for Both Cluster 2 and 7 == | == Instructions for Both Cluster 2 and 7 == | ||
| Line 41: | Line 49: | ||
=== Ansible Playbook === | === Ansible Playbook === | ||
To run full instructions or playbooks | |||
ansible-playbook -bkK <path_to_instructions.yml> | |||
The playbooks are located in | |||
/etc/ansible/playbooks | |||
The directories are labeled | |||
* maintenance - to check disks and hardware | |||
* slurm - install and maintain slurm software and configs | |||
* system - provisioning bare metal and virtual machines | |||
==== Must-Have Flags ==== | |||
* -b, --become run operations with become (does not imply password prompting) | |||
* -k, --ask-pass ask for connection password | |||
* -K, --ask-become-pass | |||
Latest revision as of 22:51, 8 October 2026
Introduction
Ansible is provisioning tool for bare-metal and virtual machines.
Warning
These commands should only be used by privileged users.
Do not use these instructions if you do not have patience to read them.
One mistake can be very bad.
Instructions for Both Cluster 2 and 7
Important Notes/Variables
- Ansible Head Nodes
- Cluster 2: epyc
- Cluster 7: login01
- Ansible path is
/etc/ansible
- List hosts in the inventory file
ansible-inventory --list all OR cat /etc/ansible/hosts
Ansible Console
To access a terminal interface use the below command
ansible-console -bkK <optional flags>
Examples:
ansible-console -bkK ansible-console -bkK -l zfs ansible-console -bkK -l slurmd
An ansible-console command without other flags will SSH into all defined hosts in the inventory list.
Must-Have Flags
- -b, --become run operations with become (does not imply password prompting)
- -k, --ask-pass ask for connection password
- -K, --ask-become-pass
Optional Useful Flags
- -l SUBSET, --limit SUBSET
- -T TIMEOUT, --timeout TIMEOUT
Ansible Playbook
To run full instructions or playbooks
ansible-playbook -bkK <path_to_instructions.yml>
The playbooks are located in
/etc/ansible/playbooks
The directories are labeled
- maintenance - to check disks and hardware
- slurm - install and maintain slurm software and configs
- system - provisioning bare metal and virtual machines
Must-Have Flags
- -b, --become run operations with become (does not imply password prompting)
- -k, --ask-pass ask for connection password
- -K, --ask-become-pass