From 73df5fa582086d23970e8260e57a5b5b6b062bbc Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 4 Feb 2024 21:25:14 +0100 Subject: [PATCH] refactor: consul in first of hashicorp stack --- ansible/playbooks/HashicorpStack.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ansible/playbooks/HashicorpStack.yml b/ansible/playbooks/HashicorpStack.yml index 71bc714..a17d3b3 100644 --- a/ansible/playbooks/HashicorpStack.yml +++ b/ansible/playbooks/HashicorpStack.yml @@ -1,4 +1,10 @@ --- +- name: Consul install + hosts: all + roles: + - role: ansible-consul + become: true + - name: Vault install hosts: homelab roles: @@ -9,6 +15,7 @@ ansible.builtin.stat: path: "{{ vault_unseal_keys_dir_output }}/rootkey" register: rootkey_exist + delegate_to: localhost - name: Reading root contents ansible.builtin.command: cat "{{ vault_unseal_keys_dir_output }}/rootkey" register: root_token @@ -37,13 +44,11 @@ nomad_vault_token: "{{ nomad_token_data.login.auth.client_token }}" when: nomad_token_data.login is defined -- name: Hashicorp stack +- name: nomad hosts: all vars: unseal_keys_dir_output: ~/vaultunseal roles: - - role: ansible-consul - become: true - role: ansible-nomad become: true - role: docker