ansible-collection-prometheus/roles/ipmi_exporter/tasks/main.yml

64 lines
1.6 KiB
YAML
Raw Normal View History

---
- name: Preflight
ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- ipmi_exporter_install
- ipmi_exporter_configure
- ipmi_exporter_run
tags:
- ipmi_exporter_install
- ipmi_exporter_configure
- ipmi_exporter_run
- name: Install
ansible.builtin.include_tasks:
file: install.yml
apply:
become: true
tags:
- ipmi_exporter_install
when:
( not __ipmi_exporter_is_installed.stat.exists ) or
( (__ipmi_exporter_current_version_output.stderr_lines | length > 0)
and (__ipmi_exporter_current_version_output.stderr_lines[0].split(" ")[2] != ipmi_exporter_version) ) or
( (__ipmi_exporter_current_version_output.stdout_lines | length > 0)
and (__ipmi_exporter_current_version_output.stdout_lines[0].split(" ")[2] != ipmi_exporter_version) ) or
( ipmi_exporter_binary_local_dir | length > 0 )
tags:
- ipmi_exporter_install
- name: SELinux
ansible.builtin.include_tasks:
file: selinux.yml
apply:
become: true
tags:
- ipmi_exporter_configure
when: ansible_selinux.status == "enabled"
tags:
- ipmi_exporter_configure
- name: Configure
ansible.builtin.include_tasks:
file: configure.yml
apply:
become: true
tags:
- ipmi_exporter_configure
tags:
- ipmi_exporter_configure
- name: Ensure ipmi_exporter is enabled on boot
become: true
ansible.builtin.systemd:
daemon_reload: true
name: ipmi_exporter
enabled: true
state: started
when:
- not ansible_check_mode
tags:
- ipmi_exporter_run