ansible-collection-prometheus/roles/snmp_exporter/tasks/configure.yml
prombot e39934bc49
fix: Don't log config deployments
Avoid logging on some config files may contain secrets.

Fixes: https://github.com/prometheus-community/ansible/issues/72

Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-03-17 11:34:30 +01:00

38 lines
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
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
group: root
mode: 0644
register: _download_config
until: _download_config is success
retries: 5
delay: 2
notify:
- reload snmp exporter
when: not (snmp_exporter_config_file)
- name: Copy configuration file
ansible.builtin.template:
src: "{{ snmp_exporter_config_file }}"
dest: /etc/snmp_exporter/snmp.yml
owner: root
group: root
mode: 0644
no_log: "{{ 'false' if lookup('env', 'CI') else 'true' }}"
notify:
- reload snmp exporter
when: (snmp_exporter_config_file)