diff --git a/.gitignore b/.gitignore index 973bdc4..644b295 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode/ .vaultpass +.pyenv diff --git a/README.md b/README.md index ed715b1..5040b75 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,18 @@ Instal Ansible on Debian. apt install ansible ``` +Install dependencies. +``` +ansible-galaxy collection install -r collections/requirements.yml +``` + +Create Python virtual environment. +``` +python3 -m venv .pyenv +source .pyenv/bin/activate +pip install -r requirements.txt +``` + ## Run playbook Before merging changes into protected branches, playbooks should be tested @@ -45,3 +57,5 @@ be used, it is ovelay over the original *ansible-playbook* command. * https://docs.ansible.com/ansible/latest/reference_appendices/config.html * https://docs.ansible.com/ansible/latest/collections/ansible/builtin/gather_facts_module.html * https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html +* https://www.passbolt.com/blog/managing-secrets-in-ansible-using-passbolt +* https://galaxy.ansible.com/ui/repo/published/anatomicjc/passbolt/ diff --git a/ansible.cfg b/ansible.cfg index 2d15a49..8dd7b9f 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -2,7 +2,7 @@ remote_user = root host_key_checking = False roles_path = ./roles -inventory = ./inventories/production +inventory = ./inventories/servers gathering = smart interpreter_python = auto_silent diff --git a/collections/README.md b/collections/README.md index 9566a14..5868f6a 100644 --- a/collections/README.md +++ b/collections/README.md @@ -1,8 +1,8 @@ ## Collections -The purpose of collections is get more modules and plugins to use in ansible. - -Collections are supported by Ansible community. +The purpose of collections is get more modules and plugins to use in ansible. +Place your collection dependencies here in *requirements.yml* and AWX will +install them automtatically. # Install collections diff --git a/collections/requirements.yml b/collections/requirements.yml index a745157..ec5156f 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -11,3 +11,6 @@ collections: - name: ansible.windows version: '>=2.3.0' type: galaxy +- name: anatomicjc.passbolt + version: '>=0.0.14' + type: galaxy diff --git a/playbooks/passbolt.yml b/playbooks/passbolt.yml new file mode 100644 index 0000000..20ec1cc --- /dev/null +++ b/playbooks/passbolt.yml @@ -0,0 +1,10 @@ +- name: Fetch passbolt password + hosts: all + gather_facts: no + tasks: + - name: Print password + debug: + msg: "Variable: {{ lookup(passbolt, 'test') }}" + vars: + passbolt: 'anatomicjc.passbolt.passbolt' + passbolt_inventory: 'anatomicjc.passbolt.passbolt_inventory' diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8adf616 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +py-passbolt==0.0.18