adfinis-sygroup.icinga2_master

GitHub Readme

角色 ICINGA2_MASTER

image

image

image

此角色配置 icinga2 作为主节点。此外,该角色还负责所有客户端的配置。

要求

当 icinga2_master_ido_enabled 被开启时,该角色尝试激活 icinga2 的 IDO 功能。这需要一个运行中的数据库,可以是已有的数据库或使用 adfinis.mariadb 角色。注意:在使用多主节点设置时,仅需为两个实例使用一个数据库!

角色变量

# icinga2 主节点区域
icinga2_master_master_zone: monitoring-master

# 所有 icinga2 API 用户的列表
icinga2_master_api_users: []
#  - username: root
#    password: 'passw0rd'
#    permissions: '*'
#  - username: token-generator
#    password: 'passw0rd'
#    permissions: 'actions/generate-ticket'

模板可以使用变量进行调整。

## 模板设置

# 如果您在 /etc/icinga2/conf.d 中有自己的配置文件模板,请考虑在此调整名称并将您的模板添加到 playbook 文件夹根目录下的 templates/etc/icinga2/conf.d 中。
icinga2_master_template_confd_notifications: "notifications.conf"
icinga2_master_template_confd_templates: "templates.conf"
icinga2_master_template_confd_commands: "commands.conf"
icinga2_master_template_confd_groups: "groups.conf"
icinga2_master_template_confd_timeperiods: "timeperiods.conf"
icinga2_master_template_confd_users: "users.conf"

# 如果您有自定义模板用于全局模板目录,这些变量可以进行调整,该目录会同步到所有客户端。
icinga2_master_template_globaltemplates:
  - "services.conf"
  - "templates.conf"

如果您想使用 Twilio 进行告警,您可以创建一个帐户。之后,您可以从 Twilio 控制台获取应用程序 SID 和 Auth token。如果您计划进行电话拨打,请创建一个 TwiML 应用程序。

## Twilio 告警

# https://www.twilio.com/console 中的帐户 SID
#icinga2_master_twilio_account_sid: 'account_sid'

# https://www.twilio.com/console 中的 Auth token
#icinga2_master_twilio_auth_token: 'auth_token'

# 是否启用 Twilio 短信
icinga2_master_twilio_sms_enabled: False

# 用于发送短信的 Twilio 电话号码
#icinga2_master_twilio_sms_from: '+41123456789'

# Twilio 短信脚本附加命令
# 可在发送短信后执行自定义脚本,默认为空列表,必要时添加命令行
# 示例:
#icinga2_master_twilio_sms_additional_commands:
#  # 在发送短信后执行自定义脚本,将通知还发送到 Mattermost
#  - "/etc/icinga2/scripts/mattermost.sh "${NOTIFICATION_MESSAGE}""
icinga2_master_twilio_sms_additional_commands: []

# 是否启用 Twilio 电话拨打
icinga2_master_twilio_phone_enabled: False

# 用于拨打电话的 Twilio 电话号码
#icinga2_master_twilio_phone_from: '+41123456789'

# Twilio 应用程序用于处理电话。您可以选择应用程序 SID 或应用程序 URL。只能选择一个,默认为未定义。
# https://www.twilio.com/docs/voice/make-calls
#icinga2_master_twilio_phone_application_sid: 'application_sid'
#icinga2_master_twilio_phone_application_url: 'application_url'

角色特殊主机组

以下名称将在 ansible 组选择器的上下文中使用,并在角色内部进行评估。它们的特殊含义将更详细地描述(!!待办事项!!)。

  • monitoring_client
  • monitoring_master
  • monitoring_sat

依赖关系

此角色依赖于角色 adfinis.icinga2_agent,该角色安装 icinga2 二进制文件。

示例 Playbook

- hosts: monitoring-master
  roles:
     - { role: adfinis.icinga2_agent }
     - { role: adfinis.icinga2_master }

许可证

GPL-3.0

作者信息

icinga2_master 角色由以下人员编写:

关于项目

This role is used to configure icinga2 in master mode

安装
ansible-galaxy install adfinis-sygroup.icinga2_master
许可证
gpl-3.0
下载
3.8k
拥有者
Adfinis SyGroup was rebranded to Adfinis, follow the link below: