ansible-collection-prometheus/roles/pushgateway/tasks/configure.yml
SuperQ c676915376
feat: Add pushgateway role
Add role to manage the Prometheus Pushgateway.

Signed-off-by: SuperQ <superq@gmail.com>
2023-07-11 08:31:38 +02:00

36 lines
958 B
YAML

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