{"id":16780101,"url":"https://github.com/voidquark/node_exporter","last_synced_at":"2025-03-22T00:31:15.437Z","repository":{"id":177710969,"uuid":"660794608","full_name":"voidquark/node_exporter","owner":"voidquark","description":"Ansible Role - Node Exporter","archived":false,"fork":false,"pushed_at":"2024-08-14T13:56:47.000Z","size":62,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T06:23:15.313Z","etag":null,"topics":["almalinux","ansible","ansible-galaxy","ansible-playbook","ansible-role","automation","fedora","linux","node-exporter","redhat","rhel","rockylinux"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/ui/standalone/roles/voidquark/node_exporter/","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voidquark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-30T21:42:02.000Z","updated_at":"2024-08-14T13:50:15.000Z","dependencies_parsed_at":"2023-11-09T16:29:39.485Z","dependency_job_id":"68b60e04-e897-454a-b1ed-781675e3ed37","html_url":"https://github.com/voidquark/node_exporter","commit_stats":null,"previous_names":["voidquark/node_exporter"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidquark%2Fnode_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidquark%2Fnode_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidquark%2Fnode_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidquark%2Fnode_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voidquark","download_url":"https://codeload.github.com/voidquark/node_exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890102,"owners_count":20527030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["almalinux","ansible","ansible-galaxy","ansible-playbook","ansible-role","automation","fedora","linux","node-exporter","redhat","rhel","rockylinux"],"created_at":"2024-10-13T07:34:02.353Z","updated_at":"2025-03-22T00:31:15.136Z","avatar_url":"https://github.com/voidquark.png","language":"Jinja","readme":"# Ansible role - Node Exporter\n\n[![License](https://img.shields.io/github/license/voidquark/node_exporter)](LICENSE)\n\nNode Exporter role is designed to simplify the installation and configuration of Node Exporter on various Linux distributions. [Node Exporter](https://github.com/prometheus/node_exporter) is a popular Prometheus exporter that collects hardware and operating system metrics from Linux systems.\n\nThis role provides a straightforward way to deploy Node Exporter across systems from the Red Hat Enterprise Linux (RHEL) family, including `RHEL 8`, `RHEL 9`, `Rocky Linux`, `Alma Linux`, `CentOS`, and `Fedora`. It has been tested extensively on `RHEL 8` and `RHEL 9`, ensuring compatibility and reliability.\n\n**Role support two scenarios:**\n- **Deployment:** This scenario is idempotent and ensures that Node Exporter is in the required state (`present`). It installs and configures Node Exporter on the target system.\n- **Uninstall:** This scenario ensures that everything deployed by the role is removed and cleaned up (`uninstall`). It removes Node Exporter from the target system.\n\n**Role Key feature**:\n- **Easy Installation/Uninstall**: The role simplifies the installation and uninstallation processes for Node Exporter, making it quick and hassle-free.\n- **Customizable Configuration**: The role provides various configuration options that can be customized according to your needs. This allows you to tailor the deployment of Node Exporter to suit your specific requirements.\n- **Version Flexibility**: Allowing users to set the version to either “latest” or a specific version like “1.6.0”. This simple and intuitive feature empowers users to easily control the Node Exporter version according to their deployment requirements.\n\n📢 **[Check the blog post](https://voidquark.com/blog/simplify-node-exporter-deployment-with-ansible/)** 📝 **Experience a step-by-step demo of deploying and uninstalling Node Exporter using my Ansible role.**\n\n## Requirements\n\nNo requirements\n\n## Role Variables\n\n- **Default Variables**. Usually, there is no need to change this but rather overwrite the value in `host_vars` or `group_vars` if required.\n\n| Variable Name  | Default Value | Description\n| ----------- | ----------- | ----------- |\n| `node_exporter_version` | `\"latest\"` | The version of Node Exporter to download and deploy. Supported standard version \"1.6.0\" format or \"latest\".\n| `node_exporter_binary_path` | `/usr/local/bin` | The path where the Node Exporter binary is located.\n| `node_exporter_user` | `\"node_exporter\"` | The user under which the Node Exporter service runs. This user is marked as a system user.\n| `node_exporter_group` | `\"node_exporter\"` | The system group associated with the Node Exporter service.\n| `node_exporter_web_listen_address` | `\"0.0.0.0\"` | The address on which Node Exporter listens for HTTP requests. By default, it listens on all interfaces.\n| `node_exporter_listen_port` | `9100` | The TCP port on which Node Exporter listens for incoming connections. By default, it listens on port `9100`.\n| `node_exporter_expose_port` | `true` | Set to `true` by default, controls whether to add a firewalld rule for exposing the Node Exporter port. When `true`, a firewalld rule is added to allow inbound traffic on the specified Node Exporter port. Set to `false` to ensure that firewalld rule is not present.\n| `node_exporter_arch` | `\"amd64\"` | The architecture of the Linux system for which Node Exporter is being deployed.\n| `node_exporter_download_url` | \u003cpre\u003e`https://github.com/`\u003cbr\u003e`prometheus/`\u003cbr\u003e`node_exporter/releases/`\u003cbr\u003e`download/`\u003cbr\u003e`v{{ node_exporter_version }}`\u003cbr\u003e`/node_exporter-`\u003cbr\u003e`{{ node_exporter_version }}`\u003cbr\u003e`.linux-`\u003cbr\u003e`{{ node_exporter_arch }}.tar.gz`\u003c/pre\u003e | The default download URL for the Node Exporter package from GitHub.\n\n- **group_vars** or **host_vars** variables.\n\n| Variable Name | Example Usage | Required | Description\n| ----------- | ----------- | ----------- | ----------- |\n| `node_exporter_runtime_flags` | \u003cpre\u003enode_exporter_runtime_flags:\u003cbr\u003e\u0026emsp;- \"--collector.textfile.directory {{ node_exporter_textfile_path }}\"\u003cbr\u003e\u0026emsp;- \"--collector.systemd\"\u003cbr\u003e\u0026emsp;- \"--collector.network_route\"\u003c/pre\u003e | No | Optional execution flags injected into the systemd unit file for Node Exporter. You can refer to the official [node exporter Github repo](https://github.com/prometheus/node_exporter) to obtain a list of available collectors.\n| `node_exporter_textfile_path` | `\"/var/lib/node_exporter\"` | NO(required when runtime flag textfile is defined) | If you define the `--collector.textfile.directory` flag in the `node_exporter_runtime_flags` variable, it is required to specify the directory path. By default, the directory is not created. The [textfile collector](https://www.robustperception.io/using-the-textfile-collector-from-a-shell-script/#more-4014) serves a specific purpose as explained in the provided link.\n\n## Dependencies\n\nNo Dependencies\n\n## Deployment and Uninstall Playbook\n\n- Deployment playbook (`function_node-exporter_deploy.yml`)\n```yaml\n- name: Deploy node_exporter service\n  hosts: node_exporter\n  gather_facts: false\n  become: true\n  roles:\n    - role: voidquark.node_exporter\n      state: present\n```\n\n- Uninstall playbook (`function_node-exporter_uninstall.yml`)\n```yaml\n- name: Uninstall node_exporter service\n  hosts: node_exporter\n  gather_facts: false\n  become: true\n  roles:\n    - role: voidquark.node_exporter\n      state: absent\n```\n\n## Example Execution\n\n- Deployment playbook\n```yaml\nansible-playbook -i inventory/hosts function_node-exporter_deploy.yml\n```\n\n- Uninstall playbook. Ensure that you provided limit to remove only specified host!\n```yaml\nansible-playbook -i inventory/hosts function_node-exporter_uninstall.yml --limit \"node2.voidquark.com\"\n```\n\n## Directory Structure Example\n\nHere is an example of how you can organize your files using a directory structure for your Ansible project. This structure demonstrates where to place the playbook (deploy/uninstall), the inventory file, and where to include this role.\n\n```shell\nansible_structure\n├── automation\n│   ├── function_node-exporter_deploy.yml # Deployment playbook\n│   └── function_node-exporter_uninstall.yml # Uninstall playbook\n└── inventory\n    ├── group_vars\n    │   └── node_exporter\n    │       └── node_exporter_vars.yml # Overwrite variables in group_vars (optional)\n    ├── hosts\n    └── host_vars\n        ├── node1.voidquark.com\n        │   └── host_vars.yml # Overwrite variables in host_vars (optional)\n        └── node2.voidquark.com\n            └── host_vars.yml # Overwrite variables in host_vars (optional)\n```\n\n- inventory `hosts` file example:\n```toml\n[node_exporter]\nnode1.voidquark.com\nnode2.voidquark.com\n```\n\n## License\n\nMIT\n\n## Contribution\n\nFeel free to customize and enhance the role according to your needs.\nYour feedback and contributions are greatly appreciated. Please open an issue or submit a pull request with any improvements.\n\n## Author Information\n\nCreated by [VoidQuark](https://voidquark.com)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidquark%2Fnode_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoidquark%2Fnode_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidquark%2Fnode_exporter/lists"}