community.general.logentries 回调 – 将事件发送到 Logentries
注意
此回调插件是 community.general 集合 (版本 10.1.0) 的一部分。
如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。您需要其他需求才能使用此回调插件,请参阅 需求了解详情。
要在 playbook 中使用它,请指定:community.general.logentries。
回调插件
此插件是**通知回调**。它将 playbook 运行的信息发送到其他应用程序、服务或系统。有关回调插件的更多信息,请参阅 回调插件。
概要
- 此回调插件将生成 JSON 对象,并通过 TCP 将它们发送到 Logentries,用于审计/调试目的。 
- 在 2.4 之前,如果要使用 ini 配置,则必须将文件放在与该插件相同的目录中,并命名为 - logentries.ini。
- 在 2.4 及更高版本中,您可以将其直接放在 Ansible 主配置文件中。 
需求
以下需求是在执行此回调的本地控制器节点上需要的。
- 配置中的白名单 
- certifi(Python 库) 
- flatdict(Python 库),如果您想使用 - flatten选项
参数
| 参数 | 注释 | 
|---|---|
| Logentries API 的 URI。 默认值:  配置 
 | |
| 将复杂的数据结构展平为单个具有复杂键的字典。 选项 
 配置 
 | |
| 启用 TLS 时连接到 API 时使用的端口。 默认值:  配置 
 | |
| 切换以决定是否使用 TLS 加密与 API 服务器的通信。 选项 
 配置 
 | 
示例
examples: >
  To enable, add this to your ansible.cfg file in the defaults block
    [defaults]
    callback_whitelist = community.general.logentries
  Either set the environment variables
    export LOGENTRIES_API=data.logentries.com
    export LOGENTRIES_PORT=10000
    export LOGENTRIES_ANSIBLE_TOKEN=dd21fc88-f00a-43ff-b977-e3a4233c53af
  Or in the main Ansible config file
    [callback_logentries]
    api = data.logentries.com
    port = 10000
    tls_port = 20000
    use_tls = true
    token = dd21fc88-f00a-43ff-b977-e3a4233c53af
    flatten = false
