Ad-hoc copy file ansible
Copy a file to all hosts
ansible all -i inventory -m copy -a 'src=./file dest=/tmp/file'
more ansible
all 56 commands →
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
View encrypted file
ansible-vault view vars/secrets.yml