fix: use new hashistack role on preflight playbook

This commit is contained in:
Bertrand Lanson 2024-08-03 10:56:56 +02:00
parent 459d176979
commit 9bd5d0222e
Signed by: lanson
SSH Key Fingerprint: SHA256:/nqc6HGqld/PS208F6FUOvZlUzTS0rGpNNwR5O2bQBw

View File

@ -7,8 +7,10 @@
become: true become: true
tasks: tasks:
- name: "Import variables" - name: "Import variables"
ansible.builtin.import_tasks: ansible.builtin.include_role:
file: tasks/load_vars.yml name: ednz_cloud.hashistack.hashistack
tags:
- always
- name: "Checking vault inventory" - name: "Checking vault inventory"
ansible.builtin.assert: ansible.builtin.assert:
@ -46,44 +48,44 @@
when: when:
- enable_nomad | bool - enable_nomad | bool
- name: "Checking directory {{ configuration_directory }}" # noqa: run-once[task] - name: "Checking directory {{ hashistack_configuration_directory }}" # noqa: run-once[task]
delegate_to: localhost delegate_to: localhost
run_once: true run_once: true
block: block:
- name: "Stat directory {{ configuration_directory }}" - name: "Stat directory {{ hashistack_configuration_directory }}"
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ configuration_directory }}" path: "{{ hashistack_configuration_directory }}"
register: _stat_config_dir register: _stat_config_dir
- name: "Stat nomad_servers config directory" - name: "Stat nomad_servers config directory"
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ sub_configuration_directories.nomad_servers }}" path: "{{ hashistack_sub_configuration_directories.nomad_servers }}"
register: _stat_config_dir_nomad_servers register: _stat_config_dir_nomad_servers
when: when:
- enable_nomad | bool - enable_nomad | bool
- name: "Stat consul_servers config directory" - name: "Stat consul_servers config directory"
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ sub_configuration_directories.consul_servers }}" path: "{{ hashistack_sub_configuration_directories.consul_servers }}"
register: _stat_config_dir_consul_servers register: _stat_config_dir_consul_servers
when: when:
- enable_consul | bool - enable_consul | bool
- name: "Stat vault_servers config directory" - name: "Stat vault_servers config directory"
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ sub_configuration_directories.vault_servers }}" path: "{{ hashistack_sub_configuration_directories.vault_servers }}"
register: _stat_config_dir_vault_servers register: _stat_config_dir_vault_servers
when: when:
- enable_vault | bool - enable_vault | bool
- name: "Make sure directory exists: {{ configuration_directory }}" - name: "Make sure directory exists: {{ hashistack_configuration_directory }}"
ansible.builtin.assert: ansible.builtin.assert:
that: that:
- _stat_config_dir.stat.exists - _stat_config_dir.stat.exists
- _stat_config_dir.stat.isdir - _stat_config_dir.stat.isdir
- _stat_config_dir.stat.writeable - _stat_config_dir.stat.writeable
- name: "Make sure directory exists: {{ sub_configuration_directories.nomad_servers }}" - name: "Make sure directory exists: {{ hashistack_sub_configuration_directories.nomad_servers }}"
ansible.builtin.assert: ansible.builtin.assert:
that: that:
- _stat_config_dir_nomad_servers.stat.exists - _stat_config_dir_nomad_servers.stat.exists
@ -92,7 +94,7 @@
when: when:
- enable_nomad | bool - enable_nomad | bool
- name: "Make sure directory exists: {{ sub_configuration_directories.consul_servers }}" - name: "Make sure directory exists: {{ hashistack_sub_configuration_directories.consul_servers }}"
ansible.builtin.assert: ansible.builtin.assert:
that: that:
- _stat_config_dir_consul_servers.stat.exists - _stat_config_dir_consul_servers.stat.exists
@ -101,7 +103,7 @@
when: when:
- enable_consul | bool - enable_consul | bool
- name: "Make sure directory exists: {{ sub_configuration_directories.vault_servers }}" - name: "Make sure directory exists: {{ hashistack_sub_configuration_directories.vault_servers }}"
ansible.builtin.assert: ansible.builtin.assert:
that: that:
- _stat_config_dir_vault_servers.stat.exists - _stat_config_dir_vault_servers.stat.exists