Closed nartykalyLV closed 2 years ago
Changed playbook to
---
# File: site.yml - Example Consul site playbook
- name: Provision server
hosts: all
remote_user: nartykaly
gather_facts: False
no_log: false
tasks:
- name: Wait before cloudinit is finished
wait_for:
path: /var/lib/cloud/instance/boot-finished
- name: prepare
hosts: vault_instances
become: true
become_method: sudo
roles:
- role: robertdebock.core_dependencies
- role: robertdebock.hashicorp
tasks:
- name: Update /etc/hosts
blockinfile:
path: /etc/hosts
block: |
{% for host in groups['all'] %}
{{ hostvars[host].ansible_host }} {{ host }}
{% endfor %}
- name: Assemble Vault cluster
hosts: vault_instances
any_errors_fatal: true
become: true
become_user: root
gather_facts: true
debugger: on_failed
roles:
- robertdebock.vault
vars:
vault_show_unseal_information: yes
vault_store_root_token: yes
vault_make_backup: no
vault_leader: "{{ hostvars[groups['vault_instances'][0]].ansible_host }}"
vault_listeners:
- name: tcp
address: "127.0.0.1:8200"
cluster_address: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:8201"
tls_disable: "true"
- name: tcp
address: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:8200"
cluster_address: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:8201"
tls_disable: "true"
vault_log_level: "debug"
vault_disable_clustering: "false"
vault_api_addr: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:8200"
vault_cluster_addr: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:8201"
and it is works now.
Describe the bug
I'm trying to write IaC using terraform, ansible to setup vault cluster. I found that playbook errors, playbook run 2 of 3 passes are successful, 1 is not successful.
Playbook
Please paste the playbook you are using. (Consider
requirements.yml
and optionally the command you've invoked.)Output
Show at least the error, possible related output, maybe just all the output.
Environment