Simplify configuration file management
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
---
|
||||
- name: "Configure | Upload local configuration file"
|
||||
notify: "(Re)start and enable ipmi_exporter"
|
||||
when: ipmi_exporter_source_dir is defined and ipmi_exporter_source_dir | length > 0
|
||||
when: ipmi_exporter_local_conf is defined
|
||||
ansible.builtin.template:
|
||||
src: "{{ ipmi_exporter_source_dir }}/ipmi_local.conf"
|
||||
dest: "{{ ipmi_exporter_config_dir }}/ipmi_local.conf"
|
||||
src: "{{ ipmi_exporter_local_conf }}"
|
||||
dest: "{{ ipmi_exporter_config_dir }}/local.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0640'
|
||||
|
||||
- name: "Configure | Upload web configuration file"
|
||||
notify: "(Re)start and enable ipmi_exporter"
|
||||
when: ipmi_exporter_web_source_dir is defined and ipmi_exporter_web_source_dir | length > 0
|
||||
when: ipmi_exporter_web_conf is defined
|
||||
ansible.builtin.template:
|
||||
src: "{{ ipmi_exporter_web_source_dir }}/web_conf.yaml"
|
||||
dest: "{{ ipmi_exporter_config_dir }}/web_conf.yaml"
|
||||
src: "{{ ipmi_exporter_web_conf }}"
|
||||
dest: "{{ ipmi_exporter_config_dir }}/web.yaml"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0640'
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
rescue:
|
||||
- name: "Install | Create directories"
|
||||
loop:
|
||||
- "{{ ipmi_exporter_dir }}"
|
||||
- "{{ ipmi_exporter_config_dir }}"
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
|
||||
Reference in New Issue
Block a user