Ansible automation demo for Cygate Techdays 2019 by Christofer Tibbelin
❗ using the same inventory file from demo 3
❗ using the same simple playbook from demo 3 as a base
This example uses openssl to generate a 40 characters long password.
This Vault-Password should be secured with a PAM system such as CyberArk
openssl rand -base64 89 | head -c40 > ~/.vault-pass.common
cat ~/.vault-pass.common
sudo nano /etc/ansible/ansible.cfg
[defaults]
vault_identity_list = common@~/.vault-pass.common
nano vault_common.yml
Add your secret variables or passwords
---
sudo_password: cygate
other_secure_varible: SuperSecretVarible
ansible-vault encrypt --encrypt-vault-id common vault_common.yml
This can also be done in the inventory
gather_facts: true
vars_files:
- vault_common.yml
vars:
ansible_become_pass: "{{ sudo_password }}"
tasks:
Now we don't need to provide the sudo password and it's collected automatically.
ansible-playbook -i inventory.ini upgrade_linux.yml
Demo 5.1 🐳☑️☝️
Build a Docker container and install Check Points API software in it.