Stupid Ansible tips

Some useful Ansible hints I had collected over time from around the web.

This one runs playbook against one host only - beware of the comma at the end:

[root@somedude ~]# ansible-playbook webserver.yml -i 10.10.10.10,

Run plays with a specific tag up_named:

[root@somedude ~]# ansible-playbook  ./production.yml -i productionhosts --private-key=~/.ssh/id_ed25519_ansible_deploy --tags="up_named"

Run play with a specific tags up_named against group of servers noc:

[root@somedude ~]# ansible-playbook  ./production.yml -i ./productionhosts --private-key=~/.ssh/id_ed25519_ansible_deploy --tags="up_named" -l noc

Display facts on localhost:

[root@somedude ~]# ansible myhost -m setup