ansible-collection-prometheus/roles/chrony_exporter/tasks/main.yml
Marcus Klein 066188f60f Use variables from ansible_facts
to allow ANSIBLE_INJECT_FACT_VARS to become false

Signed-off-by: Marcus Klein <marcus.klein@open-xchange.com>
2025-01-13 09:18:50 +01:00

61 lines
2 KiB
YAML

---
- name: Preflight
ansible.builtin.include_tasks:
file: preflight.yml
tags:
- chrony_exporter_install
- chrony_exporter_configure
- chrony_exporter_run
- name: Install
ansible.builtin.include_role:
name: prometheus.prometheus._common
tasks_from: install.yml
vars:
_common_local_cache_path: "{{ chrony_exporter_local_cache_path }}"
_common_binaries: "{{ _chrony_exporter_binaries }}"
_common_binary_install_dir: "{{ chrony_exporter_binary_install_dir }}"
_common_binary_url: "{{ chrony_exporter_binary_url }}"
_common_checksums_url: "{{ chrony_exporter_checksums_url }}"
_common_system_group: "{{ chrony_exporter_system_group }}"
_common_system_user: "{{ chrony_exporter_system_user }}"
_common_config_dir: "{{ chrony_exporter_config_dir }}"
_common_binary_unarchive_opts: ['--strip-components=1']
tags:
- chrony_exporter_install
- name: SELinux
ansible.builtin.include_role:
name: prometheus.prometheus._common
tasks_from: selinux.yml
vars:
_common_selinux_port: "{{ chrony_exporter_web_listen_address | urlsplit('port') }}"
when: ansible_facts['selinux'].status == "enabled"
tags:
- chrony_exporter_configure
- name: Configure
ansible.builtin.include_role:
name: prometheus.prometheus._common
tasks_from: configure.yml
vars:
_common_system_user: "{{ chrony_exporter_system_user }}"
_common_system_group: "{{ chrony_exporter_system_group }}"
_common_config_dir: "{{ chrony_exporter_config_dir }}"
_common_tls_server_config: "{{ chrony_exporter_tls_server_config }}"
_common_http_server_config: "{{ chrony_exporter_http_server_config }}"
_common_basic_auth_users: "{{ chrony_exporter_basic_auth_users }}"
tags:
- chrony_exporter_configure
- name: Ensure Chrony Exporter is enabled on boot
become: true
ansible.builtin.systemd:
daemon_reload: true
name: chrony_exporter
enabled: true
state: started
when:
- not ansible_check_mode
tags:
- chrony_exporter_run