Various personally customized ansible scripts for my own personal infrastructure, can be used standalone or in conjuction with kvm-install-vm and bootstrap.py
if using inventory.yml via bootstrap.py then this will already by configured.
$ cat ~/.ansible.cfg
[defaults]
remote_user=
host_key_checking = False
[ssh_connection]
scp_if_ssh = True
ssh_args = -o ControlMaster=auto -o ControlPersist=60m
[privilege_escalation]
become=True
become_method=sudo
become_user=${ANSIBLE_USER}
become_ask_pass=FalseNOTE!
- defaults.yml is the default location for various variables that should remain encrypted (api keys, ssh keys, config urls, etc)
- It also contains default variables for various roles implemented throughout certain playbooks, documentation for which can be seen via Ansible Galaxy
- Strings encrypted with
ansible-vault encrypt_string --vault-id ${VAULT_FILE} '<string to encrypt>'
$ snap install yq
$ yq read playbook.yml encrypted_value | ansible-vault --vault-id vault-password decrypt
Decryption successful
mysecretstringcd ~/ansible_scripts
ansible-playbook --vault-id ${VAULT_FILE} playbook.yml