Skip to content

Commit 4253f68

Browse files
committed
fix: Install NHC scripts before nhc.conf
Install the required scripts before configuring checks in nhc.conf to avoid test failures. This prevents issues when a new test is added via a custom script, ensuring NHC does not run before the script is available.
1 parent 147966a commit 4253f68

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tasks/main.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
name: "{{ nhc_packages }}"
1212
state: "{{ 'latest' if nhc_upgrade else 'present' }}"
1313

14+
- name: Install NHC scripts
15+
loop: "{{ nhc_scripts }}"
16+
when: item.state is not defined or item.state != 'absent'
17+
ansible.builtin.copy:
18+
src: "{{ item.src }}"
19+
dest: "{{ item.dest | default('/etc/nhc/scripts/' + item.src | basename) }}"
20+
owner: root
21+
group: root
22+
mode: "0644"
23+
1424
- name: Configure nhc.conf
1525
when: nhc_config is defined
1626
ansible.builtin.template:
@@ -29,16 +39,6 @@
2939
group: root
3040
mode: "0640"
3141

32-
- name: Install NHC scripts
33-
loop: "{{ nhc_scripts }}"
34-
when: item.state is not defined or item.state != 'absent'
35-
ansible.builtin.copy:
36-
src: "{{ item.src }}"
37-
dest: "{{ item.dest | default('/etc/nhc/scripts/' + item.src | basename) }}"
38-
owner: root
39-
group: root
40-
mode: "0644"
41-
4242
- name: Remove NHC scripts
4343
loop: "{{ nhc_scripts }}"
4444
when:

0 commit comments

Comments
 (0)