ansible-collection-prometheus/roles/snmp_exporter/tasks/configure.yml
SuperQ 1d98aee69a
Fix up ansible-lint issues.
Signed-off-by: SuperQ <superq@gmail.com>
2022-09-24 10:55:09 +02:00

38 lines
1.1 KiB
YAML

---
- name: Copy the SNMP Exporter systemd service file
ansible.builtin.template:
src: snmp_exporter.service.j2
dest: /etc/systemd/system/snmp_exporter.service
owner: root
ansible.builtin.group: root
mode: 0644
notify:
- restart snmp exporter
- name: Download snmp configuration file from github repository
ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/prometheus/snmp_exporter/v{{ snmp_exporter_version }}/snmp.yml"
dest: /etc/snmp_exporter/snmp.yml
validate_certs: false
owner: root
ansible.builtin.group: root
mode: 0644
register: _download_config
until: _download_config is success
retries: 5
delay: 2
notify:
- reload snmp exporter
when: snmp_exporter_config_file == ""
- name: Copy configuration file
ansible.builtin.template:
src: "{{ snmp_exporter_config_file }}"
dest: /etc/snmp_exporter/snmp.yml
owner: root
ansible.builtin.group: root
mode: 0644
no_log: "{{ 'true' if __testing_on_travis is defined else 'false' }}"
notify:
- reload snmp exporter
when: snmp_exporter_config_file != ""