ansible-collection-prometheus/roles/mysqld_exporter/tasks/main.yml
Laurent Indermuehle d10a9292d7
fix: yaml indentation of tags inside apply
Signed-off-by: Laurent Indermuehle <laurent.indermuehle@epfl.ch>
2023-04-27 09:36:21 +02:00

63 lines
1.6 KiB
YAML

---
- name: Preflight
ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- mysqld_exporter_install
- mysqld_exporter_configure
- mysqld_exporter_run
tags:
- mysqld_exporter_install
- mysqld_exporter_configure
- mysqld_exporter_run
- name: Install
ansible.builtin.include_tasks:
file: install.yml
apply:
become: true
tags:
- mysqld_exporter_install
when:
( not __mysqld_exporter_is_installed.stat.exists ) or
( (__mysqld_exporter_current_version_output.stderr_lines | length > 0)
and (__mysqld_exporter_current_version_output.stderr_lines[0].split(" ")[2] != mysqld_exporter_version) ) or
( (__mysqld_exporter_current_version_output.stdout_lines | length > 0)
and (__mysqld_exporter_current_version_output.stdout_lines[0].split(" ")[2] != mysqld_exporter_version) ) or
( mysqld_exporter_binary_local_dir | length > 0 )
tags:
- mysqld_exporter_install
- name: SELinux
ansible.builtin.include_tasks:
file: selinux.yml
apply:
become: true
tags:
- mysqld_exporter_configure
when: ansible_selinux.status == "enabled"
tags:
- mysqld_exporter_configure
- name: Configure
ansible.builtin.include_tasks:
file: configure.yml
apply:
become: true
tags:
- mysqld_exporter_configure
tags:
- mysqld_exporter_configure
- name: Ensure MySQLd Exporter is enabled on boot
become: true
ansible.builtin.systemd:
daemon_reload: true
name: mysqld_exporter
enabled: true
state: started
when:
- not ansible_check_mode
tags:
- mysqld_exporter_run