Add readme
This commit is contained in:
parent
71261867e0
commit
794e7f1b78
4 changed files with 33 additions and 5 deletions
18
README.md
18
README.md
|
@ -1 +1,17 @@
|
||||||
## ansible-role-ping_exporter
|
## Ansible role ping_exporter
|
||||||
|
|
||||||
|
Deploys [ping_exporter](https://github.com/ajdelgado/ping_exporter) script and install it as a systemd service unit.
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
|
||||||
|
Check [defaults](/defaults/main.yml) but create a dictionary *ping_exporter* with this values:
|
||||||
|
- prometheus_host: IP or hostname of prometheus host to open access in UFW (if specified)
|
||||||
|
- targets: List of IPs to ping
|
||||||
|
- log_file: Log file for debug information (A logrotate rule will be added to rotate it)
|
||||||
|
- count: Number of pings to send to each host
|
||||||
|
- port: Port for the web service to listen
|
||||||
|
- frequency: Delay between pings to each host
|
||||||
|
- interval: Time between packets sent
|
||||||
|
- timeout: The maximum waiting time for receiving a reply in seconds
|
||||||
|
- family: IP family version to use (A string "4" or "6")
|
||||||
|
- handle_ufw: Whether to create an "allow" rule in UFW for the port and the Prometheus server IP or hostname.
|
|
@ -1,3 +1,14 @@
|
||||||
---
|
---
|
||||||
# Default values for variables of the role
|
ping_exporter:
|
||||||
# variable_name: value
|
prometheus_host: 192.168.1.1
|
||||||
|
targets:
|
||||||
|
- 1.1.1.1
|
||||||
|
- 8.8.8.8
|
||||||
|
log_file: /var/log/ping_exporter.log
|
||||||
|
count: 4
|
||||||
|
port: 8787
|
||||||
|
frequency: 10
|
||||||
|
interval: 1
|
||||||
|
timeout: 2
|
||||||
|
family: "4"
|
||||||
|
handle_ufw: yes
|
|
@ -20,6 +20,7 @@
|
||||||
rule: allow
|
rule: allow
|
||||||
port: "{{ ping_exporter['port'] }}"
|
port: "{{ ping_exporter['port'] }}"
|
||||||
src: "{{ ping_exporter['prometheus_host'] }}"
|
src: "{{ ping_exporter['prometheus_host'] }}"
|
||||||
|
when: ping_exporter['handle_ufw']
|
||||||
- name: Ensure there is a logrotate rule for ping_exporter
|
- name: Ensure there is a logrotate rule for ping_exporter
|
||||||
template:
|
template:
|
||||||
dest: /etc/logrotate.d/ping_exporter
|
dest: /etc/logrotate.d/ping_exporter
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Ensure installation
|
- name: Ensure installation of script ping_exporter
|
||||||
include_tasks: install.yml
|
include_tasks: install.yml
|
||||||
- name: Ensure configuration
|
- name: Ensure configuration of script ping_exporter
|
||||||
include_tasks: configure.yml
|
include_tasks: configure.yml
|
Loading…
Reference in a new issue