mirror of
https://github.com/prometheus-community/ansible
synced 2025-03-02 14:07:18 +00:00
39 lines
1.4 KiB
YAML
39 lines
1.4 KiB
YAML
|
---
|
||
|
- name: Download snmp_exporter binary to local folder
|
||
|
become: false
|
||
|
get_url:
|
||
|
url: "https://github.com/prometheus/snmp_exporter/releases/download/v{{ snmp_exporter_version }}/snmp_exporter-{{ snmp_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz"
|
||
|
dest: "/tmp"
|
||
|
checksum: "sha256:{{ snmp_exporter_checksum }}"
|
||
|
register: _download_binary
|
||
|
until: _download_binary is success
|
||
|
retries: 5
|
||
|
delay: 2
|
||
|
delegate_to: localhost
|
||
|
check_mode: false
|
||
|
|
||
|
- name: Unpack snmp_exporter binary
|
||
|
become: false
|
||
|
unarchive:
|
||
|
src: "/tmp/snmp_exporter-{{ snmp_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz"
|
||
|
dest: "/tmp"
|
||
|
creates: "/tmp/snmp_exporter-{{ snmp_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}/snmp_exporter"
|
||
|
delegate_to: localhost
|
||
|
check_mode: false
|
||
|
|
||
|
- name: Propagate SNMP Exporter binaries
|
||
|
copy:
|
||
|
src: "/tmp/snmp_exporter-{{ snmp_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}/snmp_exporter"
|
||
|
dest: "/usr/local/bin/snmp_exporter"
|
||
|
mode: 0755
|
||
|
notify:
|
||
|
- restart snmp exporter
|
||
|
|
||
|
- name: Create configuration directory
|
||
|
file:
|
||
|
path: "/etc/snmp_exporter"
|
||
|
state: directory
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0755
|