Dry run (check mode) ansible
Simulate execution without making changes
ansible-playbook -i inventory playbook.yml --check --diff
more ansible
all 56 commands →
Ad-hoc ping all hosts
ansible all -i inventory -m ping
Ad-hoc run shell command
ansible all -i inventory -m shell -a 'uptime'
Ad-hoc copy file
ansible all -i inventory -m copy -a 'src=./file dest=/tmp/file'
Gather facts from host
ansible <host> -i inventory -m setup | jq '._ansible_facts'
Encrypt variable with vault
ansible-vault encrypt_string 'secret_value' --name 'db_password'