itnok.install_prometheus_node_exporter

安装 Prometheus Node Exporter

构建状态 GitHub 标签 Ansible 角色

在支持的主机上安装 Prometheus Node Exporter。

执行的步骤包括:

  • 查找最新的 Prometheus Node Exporter 版本 (或指定的版本)
  • 检查 Prometheus Node Exporter 的最新可用版本
  • 下载指定版本的 Prometheus Node Exporter 的 SHA256 校验和列表
  • 下载指定版本的 Prometheus Node Exporter
  • 创建一个专用的系统用户用于 Prometheus Node Exporter (如果尚未存在)
  • 从 {{ install_prometheus_node_exporter.name }} 中提取 'node_exporter'
  • 为 Prometheus Node Exporter 设置 systemd 服务文件
  • 强制 systemd 重新加载服务的配置文件
  • 启用并重启 Prometheus Node Exporter 的 systemd 服务

:exclamation: 要求


无。

:abcd: 角色变量


变量 描述 默认值
install_prometheus 要安装的 Prometheus Node Exporter 版本 latest

安装依赖项使用:

    $ ansible-galaxy install <dependecy.name>

所需 Ansible 角色的安装也可以简单地通过以下方式完成:

    $ ansible-galaxy install -r requirements.yml

:notebook: 示例剧本


以下是如何在你的剧本中使用此角色的示例:

---
- hosts: servers
  remote_user: ubuntu   # 可选(远程用户)
  gather_facts: yes     # 可选
  become: yes

  roles:
    - { role: itnok.install_prometheus_node_exporter }

  vars:
    install_prometheus: "latest"

:guardsman: 许可证


MIT (了解更多)

关于项目

Install Prometheus Node Exporter on a supported host.

安装
ansible-galaxy install itnok.install_prometheus_node_exporter
许可证
mit
下载
903
拥有者