mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-25 13:20:22 +00:00
2f1e8a4be8
Add role for deploying the chrony_exporter. Signed-off-by: SuperQ <superq@gmail.com>
36 lines
1,008 B
YAML
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"
|