Debian Codegraph @

ansible_collections/community/hashi_vault/tests/integration/targets/auth_jwt/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 block:
17 - name: Canary for JWT auth
18 vault_ci_read:
19 path: '{{ vault_jwt_canary.path }}'
20 register: canary
21
22 - name: Configure JWT
23 when: canary.result is none
24 loop: '{{ auth_paths }}'
25 include_tasks:
26 file: jwt_setup.yml
27 apply:
28 vars:
29 default_path: '{{ ansible_hashi_vault_auth_method }}'
30 this_path: '{{ item }}'
31
32 - name: Write Canary
33 when: canary.result is none
34 vault_ci_write:
35 path: '{{ vault_jwt_canary.path }}'
36 data:
37 value: '{{ vault_jwt_canary.value }}'
38
39
40 - name: Run JWT tests (controller)
41 loop: '{{ auth_paths }}'
42 include_tasks:
43 file: jwt_test_controller.yml
44 apply: &test_apply
45 vars:
46 default_path: '{{ ansible_hashi_vault_auth_method }}'
47 this_path: '{{ item }}'
48 module_defaults:
49 assert:
50 quiet: true
51
52 - name: Run JWT tests (target)
53 loop: '{{ auth_paths }}'
54 include_tasks:
55 file: jwt_test_target.yml
56 apply: *test_apply