hcp-ansible/roles/hashicorp_consul/tasks/prerequisites.yml

30 lines
835 B
YAML
Raw Normal View History

---
# task/prerequisites file for hashicorp_consul
- name: "Create group {{ hashi_consul_group }}"
ansible.builtin.group:
name: "{{ hashi_consul_group }}"
state: present
- name: "Create user {{ hashi_consul_user }}"
ansible.builtin.user:
name: "{{ hashi_consul_user }}"
group: "{{ hashi_consul_group }}"
shell: /bin/false
state: present
- name: "Create directory {{ hashi_consul_config_dir }}"
ansible.builtin.file:
path: "{{ hashi_consul_config_dir }}"
state: directory
owner: "{{ hashi_consul_user }}"
group: "{{ hashi_consul_group }}"
mode: '0755'
- name: "Create directory {{ hashi_consul_data_dir}}"
ansible.builtin.file:
path: "{{ hashi_consul_data_dir }}"
state: directory
owner: "{{ hashi_consul_user }}"
group: "{{ hashi_consul_group }}"
mode: '0755'