mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-23 04:13:05 +00:00
c676915376
Add role to manage the Prometheus Pushgateway. Signed-off-by: SuperQ <superq@gmail.com>
36 lines
958 B
YAML
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"
|