ansible-collection-prometheus/roles/chrony_exporter/tasks/configure.yml
SuperQ 2f1e8a4be8
feat: Add chrony_exporter role
Add role for deploying the chrony_exporter.

Signed-off-by: SuperQ <superq@gmail.com>
2023-07-23 23:18:40 +02:00

36 lines
1,008 B
YAML

---
- name: Copy the chrony_exporter systemd service file
ansible.builtin.template:
src: chrony_exporter.service.j2
dest: /etc/systemd/system/chrony_exporter.service
owner: root
group: root
mode: 0644
notify: restart chrony_exporter
- name: Create chrony_exporter config directory
ansible.builtin.file:
path: "/etc/chrony_exporter"
state: directory
owner: root
group: root
mode: u+rwX,g+rwX,o=rX
- name: Copy the chrony_exporter web config file
ansible.builtin.template:
src: web_config.yaml.j2
dest: /etc/chrony_exporter/web_config.yaml
owner: root
group: root
mode: 0644
notify: restart chrony_exporter
- name: Allow chrony_exporter port in SELinux on RedHat OS family
community.general.seport:
ports: "{{ chrony_exporter_web_listen_address.split(':')[-1] }}"
proto: tcp
setype: http_port_t
state: present
when:
- ansible_version.full is version_compare('2.4', '>=')
- ansible_selinux.status == "enabled"