--- - name: Copy the pushgateway systemd service file ansible.builtin.template: src: pushgateway.service.j2 dest: /etc/systemd/system/pushgateway.service owner: root group: root mode: 0644 notify: restart pushgateway - name: Create pushgateway config directory ansible.builtin.file: path: "/etc/pushgateway" state: directory owner: root group: root mode: u+rwX,g+rwX,o=rX - name: Copy the pushgateway config file ansible.builtin.template: src: web_config.yml.j2 dest: /etc/pushgateway/web_config.yml owner: root group: root mode: 0644 notify: restart pushgateway - name: Allow pushgateway port in SELinux on RedHat OS family community.general.seport: ports: "{{ pushgateway_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"