ansible/roles/vault/tasks/main.yaml

47 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2022-08-30 12:51:35 +00:00
---
- name: gather os specific variables
2022-08-31 03:19:06 +00:00
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
2022-08-30 12:51:35 +00:00
vars:
2022-08-31 03:19:06 +00:00
params:
2022-08-30 12:51:35 +00:00
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- vars
- name: include os specific tasks
2022-08-31 03:19:06 +00:00
ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}"
2022-08-30 12:51:35 +00:00
vars:
2022-08-31 03:19:06 +00:00
params:
2022-08-30 12:51:35 +00:00
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- tasks
- name: install
package:
name: "{{ vault_package_name | default('vault') }}"
state: "{{ vault_package_state | default('present') }}"
- name: configure
template:
src: "{{ vault_config_template }}"
dest: "{{ vault_config_path }}"
owner: "{{ vault_config_owner }}"
group: "{{ vault_config_group }}"
mode: "{{ vault_config_mode }}"
notify: restart vault
when: not vault_agent_enabled
- name: service
service:
name: "{{ vault_service_name | default('vault') }}"
state: "{{ vault_service_state | default('started') }}"
enabled: "{{ vault_service_enabled | default(true) }}"
when: not vault_agent_enabled