Ansible Notes

Playbook yaml options

  • Become=true Run all tasks by becoming root

  • update-cache=yes Perform an apt update before install

Playbook command line options

  • --start-at-task To start executing in the middle of the playbook from the named task

Other options

  • $ ansible-doc service Show documentation for the service module.

  • $ ansible all -i hosts -m ping to check if all servers in hosts are available.

  • $ ansible-playbook -i hosts 02-apt-update.yaml to run the playbook on the hosts defined in the hosts file.