Copy a file (ad-hoc)
Copy a file to all hosts
ansible all -i inventory -m copy -a 'src=./file dest=/tmp/file'
More ansible commands
-
ansible <host> -i inventory -m setup | jq '._ansible_facts'Collect all Ansible facts (OS, CPU, network) from a host
-
ansible-vault encrypt_string 'secret_value' --name 'db_password'Encrypt one string so you can paste it straight into a playbook
-
ansible-vault encrypt vars/secrets.ymlEncrypt a whole variables file with Ansible Vault
-
ansible-vault decrypt vars/secrets.ymlDecrypt an Ansible Vault file in place
-
ansible-vault view vars/secrets.ymlShow the contents of a vault file without decrypting it on disk