Debian Codegraph @

ansible_collections/community/hashi_vault/tests/integration/targets/auth_cert/tasks/main.yml

raw
1 ---
2 # task vars are not templated when used as vars, so we'll need to set_fact this evaluate the template
3 # see: https://github.com/ansible/ansible/issues/73268
4 - name: Persist defaults
5 set_fact:
6 '{{ item.key }}': "{{ lookup('vars', item.key) }}"
7 loop: "{{ lookup('file', role_path ~ '/defaults/main.yml') | from_yaml | dict2items }}"
8 loop_control:
9 label: '{{ item.key }}'
10
11 - name: Configuration tasks
12 module_defaults:
13 vault_ci_enable_auth: '{{ vault_plugins_module_defaults_common }}'
14 vault_ci_write: '{{ vault_plugins_module_defaults_common }}'
15 vault_ci_read: '{{ vault_plugins_module_defaults_common }}'
16 vault_ci_policy_put: '{{ vault_plugins_module_defaults_common }}'
17 block:
18 - name: Canary for cert auth
19 vault_ci_read:
20 path: '{{ vault_cert_canary.path }}'
21 register: canary
22
23 - name: Configure cert
24 when: canary.result is none
25 loop: '{{ auth_paths }}'
26 include_tasks:
27 file: cert_setup.yml
28 apply:
29 vars:
30 default_path: '{{ ansible_hashi_vault_auth_method }}'
31 this_path: '{{ item }}'
32
33 - name: Write Canary
34 when: canary.result is none
35 vault_ci_write:
36 path: '{{ vault_cert_canary.path }}'
37 data:
38 value: '{{ vault_cert_canary.value }}'
39
40
41 - name: Run cert tests (controller)
42 loop: '{{ auth_paths }}'
43 include_tasks:
44 file: cert_test_controller.yml
45 apply: &test_apply
46 vars:
47 default_path: '{{ ansible_hashi_vault_auth_method }}'
48 this_path: '{{ item }}'
49 module_defaults:
50 assert:
51 quiet: true
52
53 - name: Run cert tests (target)
54 loop: '{{ auth_paths }}'
55 include_tasks:
56 file: cert_test_target.yml
57 apply: *test_apply