How this was built up

[deprecated]

This is just a collection of things that had been done during the initial phase of the project...

Building an inventory

source

Creating a playbook

source

Build playbook to install docker and setup up container

# recommended way of executing playbook with sudo rights
ansible-playbook -i inventory.yaml pb_docker.yaml --ask-become-pass
# quick but discouraged way (usefull on testing playbooks)
ansible-playbook -t portainer -i inventory.yaml pb_docker.yaml --extra-vars "ansible_become_pass={individual become pass}"

Set up NGINX and certbot

Save sensitive variables encrypted in vars-file

# encrypt var-content by setting a password
ansible-vault encrypt_string {var_content} --ask-vault-pass

The vault password should always be the same for one host!

The result looks like that:

!vault |
          $ANSIBLE_VAULT;1.1;AES256
          30323363653431...

Add it to the vars-file:

my_variable: !vault |...

And now you let ansible-playbook prompt you for the vault-password

ansible-playbook -i production.yaml test.yaml --ask-vault-password