--- - 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"