ableton.prometheus_node_exporter

Ansible Role: ableton.prometheus_node_exporter

This role sets up the Prometheus node_exporter as a service on your specified host. If the system has a package manager that includes the node_exporter, this role will install it in that way. If not, it will build the software from its source code.

On Windows machines, this role installs windows_exporter.

Requirements

You need Ansible version 2.10 or higher. This role can install using packages on the following operating systems:

  • Debian Linux (using the apt module)
  • macOS (using the homebrew module)
  • Windows (using the win_chocolatey module)

For other systems, the installation will be done from the source. If package installation is not an option, you need to have the following software:

  • Go (golang)
  • GNU Make

This role does not install either of these on your system; you must install them before using this role.

Role Variables

Here are the role variables for configuring the node_exporter service:

  • node_exporter_args: A list of options to pass to the node_exporter service, with one option per item.
  • node_exporter_create_user: If set to true, it creates a user named node_exporter_user and a group named node_exporter_group (only for Unix systems, default is true).
  • node_exporter_group: Group for the node_exporter_user (only for Unix systems).
  • node_exporter_port: The port on which metrics will be shown.
  • node_exporter_user: The user that runs node_exporter (only for Unix systems).

These variables are used when building node_exporter from the source:

  • node_exporter_install_from_binary: If true, it will install node_exporter from a binary file, not through a package manager. This option may not work on all systems (check the "Requirements" section).
  • node_exporter_binary_arch: The architecture of the binary to download for node_exporter.
  • node_exporter_version: The version of node_exporter to install from source.

For Windows, you will use this variable:

  • windows_exporter_version: The version of windows_exporter to install via Chocolatey.

For a complete guide on required and optional role variables, see the defaults/main.yml file.

Example Playbook

---
- name: Install node_exporter on hosts
  hosts: "all"
  vars:
    node_exporter_port: 9100
    node_exporter_binary_arch: "amd64"
    node_exporter_group: "{{ ansible_user }}"
    node_exporter_user: "{{ ansible_user }}"
    node_exporter_version: "0.18.1"

  pre_tasks:
    - name: Ensure macOS hosts install from source for a specific version
      set_fact:
        node_exporter_install_from_binary: true
      when: ansible_os_family == "Darwin"

    - name: Install necessary software for macOS hosts
      homebrew:
        name: golang
        state: present

  roles:
    - ableton.prometheus_node_exporter

License

MIT

Maintainers

This project is maintained by the following GitHub users:

Informazioni sul progetto

Installs the Prometheus node exporter service

Installa
ansible-galaxy install ableton.prometheus_node_exporter
Licenza
mit
Download
38.5k
Proprietario
Ableton makes Live, Push and Link — unique software and hardware for music creation and performance.