Ansible tips and tricks
To run a playbook in parallel, include the following:
strategy: free
Example:
---
- name: Setup redhat-test-0[1-4] VMs
strategy: free
hosts: redhat-test-01,redhat-test-02,redhat-test-03,redhat-test-04
roles:
- redhat/host/redhat-test/fedora
How To. Inventory file:
[something:vars]
ansible_ssh_private_key_file=/home/sfloess/.ssh/mykeypair.pem
[something]
1.2.3.4
- Environment var
DEFAULT_VAULT_PASSWORD_FILE
: file containing password when encrypting. - Encrypt a variable:
ansible-vault encrypt_string --vault-password-file [password file] '[to encrypt]' --name 'key'
ansible-vault encrypt_string --vault-password-file ~/passwords/myVault 'mypassword' --name 'db_password'