ansible-collection-prometheus/roles/ipmi_exporter/tasks/main.yml
gardar f09635db73
refactor(ipmi_exporter): delegate common tasks to _common role
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-10-15 17:05:25 +00:00

53 lines
1.5 KiB
YAML

---
- name: Preflight
ansible.builtin.include_tasks:
file: preflight.yml
tags:
- ipmi_exporter_install
- ipmi_exporter_configure
- ipmi_exporter_run
- name: Install
ansible.builtin.include_role:
name: prometheus.prometheus._common
tasks_from: install.yml
vars:
_common_local_cache_path: "{{ ipmi_exporter_local_cache_path }}"
_common_binaries: "{{ _ipmi_exporter_binaries }}"
_common_binary_install_dir: "{{ ipmi_exporter_binary_install_dir }}"
_common_binary_url: "{{ ipmi_exporter_binary_url }}"
_common_checksums_url: "{{ ipmi_exporter_checksums_url }}"
_common_system_group: "{{ ipmi_exporter_system_group }}"
_common_system_user: "{{ ipmi_exporter_system_user }}"
_common_config_dir: "{{ ipmi_exporter_config_dir }}"
_common_binary_unarchive_opts: ['--strip-components=1']
tags:
- ipmi_exporter_install
- name: SELinux
ansible.builtin.include_role:
name: prometheus.prometheus._common
tasks_from: selinux.yml
vars:
_common_selinux_port: "{{ ipmi_exporter_web_listen_address | urlsplit('port') }}"
when: ansible_selinux.status == "enabled"
tags:
- ipmi_exporter_configure
- name: Configure
ansible.builtin.include_tasks:
file: configure.yml
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