patrickjahns.openvpn_exporter

ansible-role-openvpn-exporter

Test License Ansible Role GitHub tag

Description

This role helps you to install openvpn_exporter using Ansible. For the latest changes, check the CHANGELOG or visit the GitHub releases page.

Requirements

  • Ansible version 2.7 or higher

Role Variables

All customizable variables are listed in the defaults/main.yml file and the table below:

Name Default Value Description
openvpn_exporter_version 1.1.2 Version of the openvpn_exporter to install
openvpn_exporter_system_user openvpn_exporter The user that openvpn_exporter will run as
openvpn_exporter_system_group openvpn_exporter The group that the openvpn_exporter user belongs to
openvpn_exporter_user_additional_groups "" Extra groups the user should belong to (e.g., openvpn)
openvpn_exporter_install_dir /opt/openvpn_exporter Directory where openvpn_exporter will be installed
openvpn_exporter_config_web_address "" See openvpn_exporter documentation
openvpn_exporter_config_web_path "" See openvpn_exporter documentation
openvpn_exporter_config_web_root "" See openvpn_exporter documentation
openvpn_exporter_disable_client_metrics False See openvpn_exporter documentation
openvpn_exporter_config_enable_golang_metrics False See openvpn_exporter documentation
openvpn_exporter_config_log_level "info" See openvpn_exporter documentation
openvpn_exporter_config_status_files [] Path(s) to the status files - See openvpn_exporter documentation

Example Playbook

---
- hosts: all
  roles:
    - role: patrickjahns.openvpn_exporter
      vars:
        openvpn_exporter_config_status_files:
          - /etc/openvpn/server1.status
          - servername:/etc/openvpn/server2.status

Local Testing

To test the role locally, it's best to use Docker and molecule (v3.x). You need to have Docker installed on your system. For installation instructions, refer to the "Get started" section for a suitable Docker package.

We use tox to make testing on different Ansible versions easier. Install tox with:

pip3 install tox

Run tests for all Ansible versions (this may take a while):

tox

To run a specific molecule command on a custom environment with only the default test scenario:

tox -e ansible29 -- molecule test -s default

For more info about molecule, check their documentation.

If you want to run tests on a remote Docker host, set the DOCKER_HOST variable before running the tox tests.

CI

We use GitHub Actions to test and validate this Ansible role with ansible-later and molecule. This setup allows us to verify how new pull requests perform with various Ansible versions and operating systems, and create test scenarios for different configurations of the role. This results in a comprehensive test matrix that may take longer than local tests, so please be patient. Molecule tests will run with multiple operating systems and Ansible versions to ensure compatibility.

License

This project is under the MIT License. For more details, see LICENSE.

Maintainers and Contributors

Informazioni sul progetto

Deploy openvpn_expoter via ansible

Installa
ansible-galaxy install patrickjahns.openvpn_exporter
Licenza
mit
Download
80.5k
Proprietario
Site Reliability Engineer with a ❤️ for "everything as code". Passionate about software craftsmanship and deliberately breaking things (aka Chaos Engineering)