2023-03-05 11:37:44 +00:00
|
|
|
---
|
|
|
|
- name: Preflight
|
2023-04-17 09:58:55 +00:00
|
|
|
ansible.builtin.include_tasks:
|
|
|
|
file: preflight.yml
|
2023-03-05 11:37:44 +00:00
|
|
|
tags:
|
|
|
|
- mysqld_exporter_install
|
|
|
|
- mysqld_exporter_configure
|
|
|
|
- mysqld_exporter_run
|
|
|
|
|
|
|
|
- name: Install
|
2024-10-15 17:07:29 +00:00
|
|
|
ansible.builtin.include_role:
|
|
|
|
name: prometheus.prometheus._common
|
|
|
|
tasks_from: install.yml
|
|
|
|
vars:
|
|
|
|
_common_local_cache_path: "{{ mysqld_exporter_local_cache_path }}"
|
|
|
|
_common_binaries: "{{ _mysqld_exporter_binaries }}"
|
|
|
|
_common_binary_install_dir: "{{ mysqld_exporter_binary_install_dir }}"
|
|
|
|
_common_binary_url: "{{ mysqld_exporter_binary_url }}"
|
|
|
|
_common_checksums_url: "{{ mysqld_exporter_checksums_url }}"
|
|
|
|
_common_system_group: "{{ mysqld_exporter_system_group }}"
|
|
|
|
_common_system_user: "{{ mysqld_exporter_system_user }}"
|
|
|
|
_common_config_dir: "{{ mysqld_exporter_config_dir }}"
|
|
|
|
_common_binary_unarchive_opts: ['--strip-components=1']
|
2023-03-05 11:37:44 +00:00
|
|
|
tags:
|
|
|
|
- mysqld_exporter_install
|
|
|
|
|
|
|
|
- name: SELinux
|
2024-10-15 17:07:29 +00:00
|
|
|
ansible.builtin.include_role:
|
|
|
|
name: prometheus.prometheus._common
|
|
|
|
tasks_from: selinux.yml
|
|
|
|
vars:
|
|
|
|
_common_selinux_port: "{{ mysqld_exporter_web_listen_address | urlsplit('port') }}"
|
2023-03-05 11:37:44 +00:00
|
|
|
when: ansible_selinux.status == "enabled"
|
|
|
|
tags:
|
|
|
|
- mysqld_exporter_configure
|
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
ansible.builtin.include_tasks:
|
|
|
|
file: configure.yml
|
|
|
|
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
|