Restore source style consistency

This commit is contained in:
Alexander Gorelyshev
2025-12-19 16:08:04 +04:00
parent bda231768b
commit a5642463cc
2 changed files with 13 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
--- ---
- name: "Upload ipmi_exporter local configure 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_source_dir is defined and ipmi_exporter_source_dir | length > 0
ansible.builtin.template: ansible.builtin.template:
@@ -9,7 +9,7 @@
group: root group: root
mode: '0640' mode: '0640'
- name: "Upload ipmi_exporter web configure 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_source_dir is defined and ipmi_exporter_web_source_dir | length > 0
ansible.builtin.template: ansible.builtin.template:

View File

@@ -1,31 +1,31 @@
--- ---
- name: "Install ipmi_exporter from binary" - name: "Install | Install ipmi_exporter binary"
block: block:
- name: "Check ipmi_exporter version" - name: "Install | Check ipmi_exporter availability"
changed_when: false changed_when: false
register: ipmi_exporter_ver
ansible.builtin.command: ansible.builtin.command:
cmd: "ipmi_exporter --version" cmd: "ipmi_exporter --version"
register: ipmi_exporter_ver
- name: "Assert version correctness" - name: "Install | Assert version correctness"
ansible.builtin.assert: ansible.builtin.assert:
that: "ipmi_exporter_ver.stdout is regex('{{ ipmi_exporter_version }}')" that: "ipmi_exporter_ver.stdout is regex('{{ ipmi_exporter_version }}')"
success_msg: "ipmi_exporter version {{ ipmi_exporter_version }} is installed and working" success_msg: "ipmi_exporter version {{ ipmi_exporter_version }} is installed and working"
fail_msg: "ipmi_exporter version {{ ipmi_exporter_version }} is not installed or not working correctly" fail_msg: "ipmi_exporter version {{ ipmi_exporter_version }} is not installed or not working correctly"
rescue: rescue:
- name: "Create ipmi_exporter directories" - name: "Install | Create directories"
loop:
- "{{ ipmi_exporter_dir }}"
- "{{ ipmi_exporter_config_dir }}"
ansible.builtin.file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
owner: root owner: root
group: root group: root
mode: "0755" mode: "0755"
with_items:
- "{{ ipmi_exporter_dir }}"
- "{{ ipmi_exporter_config_dir }}"
- name: "Unarchive ipmi_exporter tar file" - name: "Install | Unarchive the tarball"
notify: "(Re)start and enable ipmi_exporter" notify: "(Re)start and enable ipmi_exporter"
ansible.builtin.unarchive: ansible.builtin.unarchive:
src: "https://github.com/prometheus-community/ipmi_exporter/releases/\ src: "https://github.com/prometheus-community/ipmi_exporter/releases/\
@@ -33,7 +33,7 @@
dest: "{{ ipmi_exporter_dir }}" dest: "{{ ipmi_exporter_dir }}"
remote_src: true remote_src: true
- name: "Move ipmi_exporter binary" - name: "Install | Rename and move the binary under PATH"
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ ipmi_exporter_dir }}/ipmi_exporter-{{ ipmi_exporter_version }}.linux-amd64/ipmi_exporter" src: "{{ ipmi_exporter_dir }}/ipmi_exporter-{{ ipmi_exporter_version }}.linux-amd64/ipmi_exporter"
dest: "/usr/local/bin/ipmi_exporter" dest: "/usr/local/bin/ipmi_exporter"
@@ -42,7 +42,7 @@
group: root group: root
remote_src: true remote_src: true
- name: Create systemd service file - name: "Install | Create a systemd service file"
ansible.builtin.template: ansible.builtin.template:
src: ipmi_exporter.service.j2 src: ipmi_exporter.service.j2
dest: /etc/systemd/system/ipmi_exporter.service dest: /etc/systemd/system/ipmi_exporter.service