ANSIBLE Commands Cheat Sheet

Here is a cli commands cheat sheet for ANSIBLE Playbook command, you can use this as a quick reminder for basic commands with a brief description for each of the commands.

What is ANSIBLE-Playbook command?

Execute tasks defined in playbook on remote machines over SSH.
# Run on all hosts defined
ansible-playbook    

# Run 10 hosts parallel
ansible-playbook  -f 10

# Verbose on successful tasks
ansible-playbook  --verbose  

# Test run
ansible-playbook  -C   

# Dry run
ansible-playbook  -C -D     

# Run on single host
ansible-playbook  -l          

# To run a command on multiple instances at once - using `servers` group from `inventory.yml`:
ansible -u ansible -i inventory.yml servers -m shell -a "ls /var"

#check syntax
ansible-playbook --syntax-check 
    

Check out the ANSIBLE-Playbook command documentation .

You can also check our MegaSh cheatsheet tool, that has 150+ searchable linux cheat sheets in one page, so you never forget a command as you work again

Check Also

Best AI tools list