File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,16 @@ nhc_upgrade: false
3838# * || check_hw_cpuinfo 2 8 8
3939# * || check_hw_physmem 1k 1TB
4040
41+ # List of custom NHC configuration files
42+ # Example:
43+ # nhc_custom_configs:
44+ # - name: nhc_epilog.conf
45+ # config:
46+ # * || check_ib_link_raw_ber
47+ # # Remove a configuration file
48+ # - name: nhc_foo.conf
49+ # state: absent
50+
4151# List of NHC environment variables
4252# See https://github.com/mej/nhc?tab=readme-ov-file#supported-variables
4353# Example:
Original file line number Diff line number Diff line change 55# * || check_something
66# *.foo || another_check 1 2 3
77
8+ # List of custom NHC configuration files
9+ nhc_custom_configs : []
10+
811nhc_packages : nhc
912
1013# List of custom NHC scripts
Original file line number Diff line number Diff line change 3030 group : root
3131 mode : " 0640"
3232
33+ - name : Configure custom NHC configuration files
34+ loop : " {{ nhc_custom_configs }}"
35+ loop_control :
36+ label : " Configure /etc/nhc/{{ item.name }}"
37+ when : item.state is not defined or item.state != 'absent'
38+ ansible.builtin.copy :
39+ content : " {{ item.config | mandatory }}"
40+ dest : " /etc/nhc/{{ item.name | mandatory }}"
41+ owner : root
42+ group : root
43+ mode : " 0640"
44+
3345- name : Configure NHC variables
3446 when : nhc_variables is defined
3547 ansible.builtin.template :
4759 ansible.builtin.file :
4860 path : " {{ item.dest | default('/etc/nhc/scripts/' + item.src | basename) }}"
4961 state : absent
62+
63+ - name : Remove NHC custom configuration files
64+ loop : " {{ nhc_custom_configs }}"
65+ loop_control :
66+ label : " Remove /etc/nhc/{{ item.name }}"
67+ when :
68+ - item.state is defined
69+ - item.state == 'absent'
70+ ansible.builtin.file :
71+ path : " /etc/nhc/{{ item.name | mandatory }}"
72+ state : absent
You can’t perform that action at this time.
0 commit comments