Ansible is an automation tool made simple.
virtualenv <env-name>
source <env-name>/bin/activate
pip install ansible
sudo apt-get update && sudo apt-get install ansible
If you are using the good ol' yum.
sudo yum install dnf dnf-plugins-core
If you are using the new dnf.
sudo dnf install ansible
sudo zypper ref && sudo zypper in ansible
sudo pacman -S ansible
For ansible ad-hoc commands you will need an inventory file. If you haven't set up one, please read here
Reboot a server
ansible <server> -a "/sbin/reboot"
Gather information from a server
ansible <server> -m setup
Copy a file
ansible <server> -m copy -a "src=/etc/hosts dest=/tmp/hosts"
You can find the offical galaxy here, including the while-true-do.
Initialize a new role directory
ansible-galaxy init <new-role>
Install from a requirements.yml
ansible-galaxy install -r requirements.yml
Install a role from galaxy.ansible.com
ansible-galaxy install <user.rolename>
You can find an example here.
Run a playbook with a given inventory
ansible-playbook -i inventory/servers servers.yml
Limit the Run to a group of servers
ansible-playbook -K -i inventory/servers servers.yml --limit webservers
Limit the run to some tags
ansible-playbook -K -i inventory/servers servers.yml --tags configuration