Ad-hoc run shell command ansible
Run a one-liner shell command on all hosts
ansible all -i inventory -m shell -a 'uptime'
more ansible
all 56 commands →
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'
Encrypt file with vault
ansible-vault encrypt vars/secrets.yml
Decrypt vault file
ansible-vault decrypt vars/secrets.yml