Simplify configuration file management
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
ipmi_exporter_version: 1.10.1
|
ipmi_exporter_version: 1.10.1
|
||||||
ipmi_exporter_dir: "/etc/exporters"
|
ipmi_exporter_dir: "/etc/exporters"
|
||||||
ipmi_exporter_config_dir: "/etc/exporters/config"
|
ipmi_exporter_config_dir: "/etc/ipmi_exporter"
|
||||||
ipmi_exporter_log_level: "info"
|
ipmi_exporter_log_level: "info"
|
||||||
ipmi_exporter_log_format: "logfmt"
|
ipmi_exporter_log_format: "logfmt"
|
||||||
ipmi_exporter_web_listen_address: "localhost:9290"
|
ipmi_exporter_web_listen_address: "localhost:9290"
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
hosts: all
|
hosts: all
|
||||||
roles:
|
roles:
|
||||||
- role: genlab.common.ipmi_exporter
|
- role: genlab.common.ipmi_exporter
|
||||||
ipmi_exporter_source_dir: "molecule/default/"
|
ipmi_exporter_config_dir: "molecule/default/"
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
---
|
---
|
||||||
- name: "Configure | Upload local configuration file"
|
- name: "Configure | Upload local configuration file"
|
||||||
notify: "(Re)start and enable ipmi_exporter"
|
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:
|
ansible.builtin.template:
|
||||||
src: "{{ ipmi_exporter_source_dir }}/ipmi_local.conf"
|
src: "{{ ipmi_exporter_local_conf }}"
|
||||||
dest: "{{ ipmi_exporter_config_dir }}/ipmi_local.conf"
|
dest: "{{ ipmi_exporter_config_dir }}/local.conf"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
|
|
||||||
- name: "Configure | Upload web configuration file"
|
- name: "Configure | Upload web configuration file"
|
||||||
notify: "(Re)start and enable ipmi_exporter"
|
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:
|
ansible.builtin.template:
|
||||||
src: "{{ ipmi_exporter_web_source_dir }}/web_conf.yaml"
|
src: "{{ ipmi_exporter_web_conf }}"
|
||||||
dest: "{{ ipmi_exporter_config_dir }}/web_conf.yaml"
|
dest: "{{ ipmi_exporter_config_dir }}/web.yaml"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
rescue:
|
rescue:
|
||||||
- name: "Install | Create directories"
|
- name: "Install | Create directories"
|
||||||
loop:
|
loop:
|
||||||
- "{{ ipmi_exporter_dir }}"
|
|
||||||
- "{{ ipmi_exporter_config_dir }}"
|
- "{{ ipmi_exporter_config_dir }}"
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ ExecStart=/usr/local/bin/ipmi_exporter \
|
|||||||
{% if ipmi_exporter_args is defined and ipmi_exporter_args | length > 0 %}
|
{% if ipmi_exporter_args is defined and ipmi_exporter_args | length > 0 %}
|
||||||
{{ ipmi_exporter_args }} \
|
{{ ipmi_exporter_args }} \
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ipmi_exporter_source_dir is defined and ipmi_exporter_source_dir | length > 0 %}
|
{% if ipmi_exporter_local_conf is defined %}
|
||||||
--config.file={{ ipmi_exporter_config_dir }}/ipmi_local.conf \
|
--config.file={{ ipmi_exporter_config_dir }}/local.conf \
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ipmi_exporter_web_source_dir is defined and ipmi_exporter_web_source_dir | length > 0 %}
|
{% if ipmi_exporter_web_conf is defined %}
|
||||||
--web.config.file={{ ipmi_exporter_config_dir }}/web_conf.yaml
|
--web.config.file={{ ipmi_exporter_config_dir }}/web.yaml
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
SyslogIdentifier=ipmi_exporter
|
SyslogIdentifier=ipmi_exporter
|
||||||
|
|||||||
Reference in New Issue
Block a user