This role is fork from ansible node exporter v0.19.0 role and works with similar principles.
Deploy prometheus frr exporter using ansible.
- Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it)
- gnu-tar on Mac deployer host (
brew install gnu-tar
)
All variables which can be overridden are stored in defaults/main.yml file as well as in table below.
Name | Default Value | Description |
---|---|---|
frr_exporter_version |
0.2.3 | Frr exporter package version. Also accepts latest as parameter. |
frr_exporter_binary_local_dir |
"/usr/local/bin" | Allows to use local packages instead of ones distributed on github. As parameter it takes a directory where frr_exporter binary is stored on host on which ansible is ran. This overrides frr_exporter_version parameter |
frr_exporter_web_listen_address |
"0.0.0.0:9342" | Address on which frr exporter will listen |
frr_exporter_enabled_collectors |
[ ospf, bgp, bgp.peer-types, bgp.peer-descriptions, bgp.peer-descriptions.plain-text ] | List of additionally enabled collectors. It adds collectors to those enabled by default |
frr_exporter_disabled_collectors |
[] | List of disabled collectors. By default frr_exporter disables collectors listed here. |
frr_exporter_system_group |
"frr-exp" | Group which will be used in systemd config to start frr_exporter |
frr_exporter_system_user |
"frr-exp" | User which will be used in systemd config to start frr_exporter |
frr_exporter_create_usergroup |
true | Create user and group im case true |
Use it in a playbook as follows:
- hosts: all
roles:
- satandyh.frr-exporter
You should reuse frr user/group. For do that use in your group_vars frr_exporter_create_usergroup: false
# Prometheus exporters: ... frr (BGP), ...
- name: Configure exporters
hosts: all
become: true
gather_facts: false
roles:
# Frr exporter
# extra vars need only for VyOS - because we not gather any facts
# be careful with selinux installation - it will try to install selinux by default
- role: frr-exporter
vars:
ansible_service_mgr: "systemd"
ansible_architecture: "x86_64"
ansible_distribution: "Debian"
ansible_selinux:
status: false
ansible_mounts:
- { mount: "/" }
tags:
- frr-exporter
Pay Your attention despite that I add a lot of OS Platforms in reality I do tests only at Debian and VyOS system only. But I'm sure that this role will also work for other too.
This project is licensed under MIT License. See LICENSE for more details.