paulfantom.rpi_exporter
Ansible Role: rpi_exporter
Description
This role helps you set up rpi-exporter using Ansible.
Requirements
- Ansible version 2.7 or higher (It may work on older versions, but it's not guaranteed)
Role Variables
You can change the default variables stored in defaults/main.yml and the table below.
Name | Default Value | Description |
---|---|---|
rpi_exporter_version |
0.6.0 | The version of rpi-exporter to install. You can also use latest . |
rpi_exporter_web_listen_address |
"0.0.0.0:9243" | The address where rpi-exporter will listen. |
rpi_exporter_system_group |
"rpi-exporter" | The system group for running rpi-exporter. |
rpi_exporter_system_user |
"rpi-exporter" | The system user for running rpi-exporter. |
Example
Playbook
You can use it in a playbook like this:
- hosts: all
roles:
- paulfantom.rpi_exporter
Local Testing
To test the role locally, you can use Docker and molecule (v2.x). Make sure Docker is installed on your system by following the "Get started" guide for your OS.
We use tox
to help with testing on multiple Ansible versions. Install it by running:
pip3 install tox
To run tests on all Ansible versions (this may take a while):
tox
To run a specific molecule command on a custom environment:
tox -e py35-ansible28 -- molecule test -s default
For more details about molecule, check their documentation.
If you want to run tests on a remote Docker host, set the DOCKER_HOST
variable before running tox tests.
Travis CI
Using molecule with Travis CI lets us test how new pull requests work with different Ansible versions and operating systems. It also allows us to create various testing scenarios for role configurations, resulting in a comprehensive test matrix that might take longer than local testing, so please be patient.
Contributing
Refer to the contributor guideline.
License
This project is under the MIT License. See the LICENSE file for more details.
ansible-galaxy install paulfantom.rpi_exporter