--- # hashistack deployment playbook - name: "Deploy" hosts: all gather_facts: true become: true tasks: - name: "Include ednxzu.hashicorp_vault" ansible.builtin.include_role: name: ednxzu.hashicorp_vault - name: "Initialize vault cluster" ednxzu.hashistack.vault_init: api_url: "http://127.0.0.1:8200" key_shares: 3 key_threshold: 2 run_once: true delegate_to: "{{ groups['vault_servers'] | first }}" register: _vault_init_secret - name: "Write vault configuration to file" ansible.builtin.copy: content: "{{ _vault_init_secret.state }}" dest: "{{ configuration_directory }}/vault/vault_config" mode: '0600' when: _vault_init_secret.state run_once: true delegate_to: localhost - name: "Debug" ansible.builtin.debug: msg: "{{ _vault_init_secret }}" when: _vault_init_secret is defined