|
5 | 5 | - name: Validate secrets created
|
6 | 6 | hosts: localhost
|
7 | 7 | gather_facts: false
|
| 8 | + tags: |
| 9 | + - validate |
| 10 | + - passwords |
8 | 11 | tasks:
|
9 | 12 | - import_role:
|
10 | 13 | name: passwords
|
11 | 14 | tasks_from: validate.yml
|
12 | 15 |
|
| 16 | +- name: Validate Ansible Galaxy installs are up to date |
| 17 | + hosts: localhost |
| 18 | + gather_facts: false |
| 19 | + become: false |
| 20 | + tags: |
| 21 | + - validate |
| 22 | + - galaxy |
| 23 | + tasks: |
| 24 | + # Can't use e.g. ansible-galaxy {role,collection} list to check installed |
| 25 | + # vs desired, as git-installed collections do not provide any metadata for |
| 26 | + # the actual installed version. |
| 27 | + # So this compares requirements.yml against a .last version produced by a |
| 28 | + # successful dev/setup-env.sh run. |
| 29 | + - assert: |
| 30 | + that: "{{ _requirements_current == _requirements_installed }}" |
| 31 | + fail_msg: | |
| 32 | + Ansible Galaxy installs are out of date: |
| 33 | +
|
| 34 | + {% for req in _requirements_installed | difference(_requirements_current) %} |
| 35 | + {{ req }} |
| 36 | + {% endfor %} |
| 37 | + |
| 38 | + Run dev/setup-env.sh to fix this. |
| 39 | + vars: |
| 40 | + # note difference filter requires lists, so need to rearrange yaml from files. |
| 41 | + _requirements_path: "{{ appliances_repository_root }}/requirements.yml" |
| 42 | + _requirements_current: "{{ (lookup('file', _requirements_path) | from_yaml).values() | flatten }}" |
| 43 | + # below produced by dev/setup-env.sh - gives empty list if file is missing: |
| 44 | + _requirements_installed: "{{ ((lookup('file', _requirements_path + '.last', errors='ignore') or '{}') | from_yaml ).values() | flatten }}" |
| 45 | + |
13 | 46 | - name: Ensure control node is in inventory
|
14 | 47 | hosts: all
|
15 | 48 | gather_facts: false
|
| 49 | + tags: |
| 50 | + - validate |
| 51 | + - openhpc |
16 | 52 | tasks:
|
17 | 53 | - assert:
|
18 | 54 | that: groups['control'] | length
|
|
21 | 57 | - name: Validate openhpc configuration
|
22 | 58 | hosts: openhpc
|
23 | 59 | gather_facts: false
|
24 |
| - tags: openhpc |
| 60 | + tags: |
| 61 | + - validate |
| 62 | + - openhpc |
25 | 63 | tasks:
|
26 | 64 | - import_role:
|
27 | 65 | name: stackhpc.openhpc
|
|
38 | 76 | - name: Validate filebeat configuration
|
39 | 77 | hosts: filebeat
|
40 | 78 | gather_facts: false
|
41 |
| - tags: filebeat |
| 79 | + tags: |
| 80 | + - validate |
| 81 | + - filebeat |
42 | 82 | tasks:
|
43 | 83 | - import_role:
|
44 | 84 | name: filebeat
|
|
51 | 91 | - grafana
|
52 | 92 | gather_facts: false
|
53 | 93 | tags:
|
| 94 | + - validate |
54 | 95 | - openondemand
|
55 | 96 | - openondemand_server
|
56 | 97 | - grafana
|
|
75 | 116 |
|
76 | 117 | - name: Validate freeipa configuration
|
77 | 118 | hosts: freeipa
|
78 |
| - tags: freeipa |
| 119 | + tags: |
| 120 | + - validate |
| 121 | + - freeipa |
79 | 122 | tasks:
|
80 | 123 | - import_role:
|
81 | 124 | name: freeipa
|
82 | 125 | tasks_from: validate.yml
|
83 | 126 |
|
84 | 127 | - name: Validate lustre configuration
|
85 | 128 | hosts: lustre
|
86 |
| - tags: lustre |
| 129 | + tags: |
| 130 | + - validate |
| 131 | + - lustre |
87 | 132 | tasks:
|
88 | 133 | - import_role:
|
89 | 134 | name: lustre
|
|
0 commit comments