mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-26 13:50:20 +00:00
82d0c730ed
Signed-off-by: gardar <gardar@users.noreply.github.com>
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
---
|
|
- name: Copy the smokeping_prober systemd service file
|
|
ansible.builtin.template:
|
|
src: smokeping_prober.service.j2
|
|
dest: /etc/systemd/system/smokeping_prober.service
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: restart smokeping_prober
|
|
|
|
- name: Create smokeping_prober config directory
|
|
ansible.builtin.file:
|
|
path: "{{ smokeping_prober_config_dir }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: u+rwX,g+rwX,o=rX
|
|
|
|
- name: Copy the smokeping_prober config file
|
|
ansible.builtin.template:
|
|
src: probes.yml.j2
|
|
dest: "{{ smokeping_prober_config_dir }}/{{ smokeping_prober_config_file }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
no_log: "{{ false if (lookup('env', 'CI')) or (lookup('env', 'MOLECULE_PROVISIONER_NAME')) else true }}"
|
|
notify: restart smokeping_prober
|
|
|
|
- name: Configure smokeping_prober web config
|
|
when:
|
|
( smokeping_prober_tls_server_config | length > 0 ) or
|
|
( smokeping_prober_http_server_config | length > 0 ) or
|
|
( smokeping_prober_basic_auth_users | length > 0 )
|
|
block:
|
|
- name: Copy the smokeping_prober web config file
|
|
ansible.builtin.template:
|
|
src: web_config.yaml.j2
|
|
dest: "{{ smokeping_prober_config_dir }}/web_config.yaml"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: restart smokeping_prober
|
|
|
|
- name: Allow smokeping_prober port in SELinux on RedHat OS family
|
|
community.general.seport:
|
|
ports: "{{ smokeping_prober_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"
|