ansible-collection-prometheus/roles/memcached_exporter/tasks/main.yml
Ben Kochie f084b71dbc
feat: Add mecached_exporter role (#256)
Add new role: `memcached_exporter`

Signed-off-by: SuperQ <superq@gmail.com>
2023-12-08 17:57:33 +01:00

63 lines
1.7 KiB
YAML

---
- name: Preflight
ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- memcached_exporter_install
- memcached_exporter_configure
- memcached_exporter_run
tags:
- memcached_exporter_install
- memcached_exporter_configure
- memcached_exporter_run
- name: Install
ansible.builtin.include_tasks:
file: install.yml
apply:
become: true
tags:
- memcached_exporter_install
when:
( not __memcached_exporter_is_installed.stat.exists ) or
( (__memcached_exporter_current_version_output.stderr_lines | length > 0)
and (__memcached_exporter_current_version_output.stderr_lines[0].split(" ")[2] != memcached_exporter_version) ) or
( (__memcached_exporter_current_version_output.stdout_lines | length > 0)
and (__memcached_exporter_current_version_output.stdout_lines[0].split(" ")[2] != memcached_exporter_version) ) or
( memcached_exporter_binary_local_dir | length > 0 )
tags:
- memcached_exporter_install
- name: SELinux
ansible.builtin.include_tasks:
file: selinux.yml
apply:
become: true
tags:
- memcached_exporter_configure
when: ansible_selinux.status == "enabled"
tags:
- memcached_exporter_configure
- name: Configure
ansible.builtin.include_tasks:
file: configure.yml
apply:
become: true
tags:
- memcached_exporter_configure
tags:
- memcached_exporter_configure
- name: Ensure memcached_exporter is enabled on boot
become: true
ansible.builtin.systemd:
daemon_reload: true
name: memcached_exporter
enabled: true
state: started
when:
- not ansible_check_mode
tags:
- memcached_exporter_run