nephelaiio.metricbeat

nephelaiio.metricbeat

构建状态 Ansible Galaxy

这是一个 ansible 角色,用于安装和配置 metricbeat。

角色变量

请查看 默认文件 以获取最新的输入参数列表。

依赖项

请查看 依赖项配置 以获取更多详细信息。

示例剧本

本模块可以通过三种主要方式配置 metricbeat:

无配置管理(适用于升级)

- hosts: servers
  vars:
    metricbeat_package_state: latest
    metricbeat_conf_manage: no
  roles:
     - role: nephelaiio.metricbeat

默认配置,活动模块自动从已安装的包中检测

- hosts: servers
  vars:
    metricbeat_conf_docker_hosts:
      - unix:///var/run/docker.sock
    metricbeat_conf_postgresql_hosts:
      - postgres://localhost:5432
    metricbeat_conf_postgresql_user: root
    metricbeat_conf_postgresql_pass: pass
    metricbeat_conf_nginx_hosts:
      - http://127.0.0.1
    metricbeat_conf_nginx_status_path: nginx_status
  roles:
     - role: nephelaiio.metricbeat

自定义配置,按原样部署配置

- hosts: servers
  vars:
    metricbeat_conf: "{{ lookup('template', 'template.j2.yml') | from_yaml }}"
  roles:
     - role: nephelaiio.metricbeat

测试

请确保您的环境中安装了 docker,以便运行角色验证测试。其他 Python 依赖项列在 需求文件 中。

角色测试针对以下发行版(docker 镜像):

  • Ubuntu Jammy
  • Ubuntu Focal
  • Debian Bookworm
  • Debian Bullseye
  • Rocky Linux 9

您可以使用命令 make test 从源代码直接测试该角色。

许可证

该项目依据 MIT 许可证 进行授权。

关于项目

An Ansible role to install and configure metricbeat

安装
ansible-galaxy install nephelaiio.metricbeat
许可证
mit
下载
26.1k
拥有者