ansible-collection-prometheus/roles/snmp_exporter/tasks/configure.yml
gardar 1173d1ada7
refactor(snmp_exporter): delegate common tasks to _common role
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-10-15 17:13:47 +00:00

29 lines
881 B
YAML

---
- name: Configure
ansible.builtin.include_role:
name: prometheus.prometheus._common
tasks_from: configure.yml
vars:
_common_system_user: "{{ snmp_exporter_system_user }}"
_common_system_group: "{{ snmp_exporter_system_group }}"
_common_config_dir: "{{ snmp_exporter_config_dir }}"
tags:
- snmp_exporter
- configure
- snmp_exporter_configure
- name: Copy configuration file
ansible.builtin.template:
src: "{{ snmp_exporter_config_file | default(snmp_exporter_local_cache_path ~ '/snmp.yml', true) }}"
dest: "{{ snmp_exporter_config_dir }}/snmp.yml"
owner: root
group: root
mode: 0644
no_log: "{{ false if (lookup('env', 'CI')) or (lookup('env', 'MOLECULE_PROVISIONER_NAME')) else true }}"
notify:
- reload snmp_exporter
become: true
tags:
- snmp_exporter
- configure
- snmp_exporter_configure