/ansible-role-install-prometheus-node-exporter

Install Prometheus Node Exporter on a supported host.

Primary LanguageJinjaMIT LicenseMIT

install-prometheus-node-exporter

Build Status GitHub tag Ansible Role

Install Prometheus Node Exporter on a supported host.

Steps performed are:

  • Find latest Prometheus Node Exporter release available (or the specified one)
  • Check latest release available of Prometheus Node Exporter
  • Download list of SHA256 checksums for the specified release of Prometheus Node Exporter"
  • Download the specified release of Prometheus Node Exporter"
  • Create a dedicated system user for Prometheus Node Exporter (if not already present)"
  • Extract 'node_exporter' from {{ install_prometheus_node_exporter.name }}"
  • Set the systemd service file up for Prometheus Node Exporter"
  • Force systemd to reread configuration files for services"
  • Enable and restart systemd service for Prometheus Node Exporter"

❗ Requirements


None.

🔡 Role Variables


Variable Description Default Value
install_prometheus Version of Prometheus Node Exporter to install latest

🔗 Dependencies


To install dependencies use:

    $ ansible-galaxy install <dependecy.name>

Installation of the required Ansible Roles can also be simply addressed with:

    $ ansible-galaxy install -r requirements.yml

📓 Example Playbook


Here an example of how to use this role in your playbooks:

---
- hosts: servers
  remote_user: ubuntu   # optional (your remote user)
  gather_facts: yes     # optional
  become: yes

  roles:
    - { role: itnok.install_prometheus_node_exporter }

  vars:
    install_prometheus: "latest"

💂‍♂️ License


MIT (read more)