community.general.logentries 模块 – 通过 logentries.com 追踪日志的模块

注意

此模块是 community.general 集合 (版本 10.1.0) 的一部分。

如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.general

要在 playbook 中使用它,请指定:community.general.logentries

概要

  • 实时发送日志到 LogEntries

参数

参数

注释

logtype

别名:type

字符串

日志类型

名称

字符串

日志名称

路径

字符串 / 必需

日志文件路径

状态

字符串

日志的后续状态

选项

  • "present" ← (默认)

  • "absent"

  • "followed"

  • "unfollowed"

属性

属性

支持

描述

check_mode

支持:完全支持

可以在 check_mode 中运行并返回更改状态预测,而无需修改目标。

diff_mode

支持:不支持

在差异模式下,将返回有关已更改内容(或可能需要在 check_mode 中更改的内容)的详细信息。

备注

注意

  • 需要 LogEntries 代理,该代理可以按照 logentries.com 上的说明进行安装。

示例

- name: Track nginx logs
  community.general.logentries:
    path: /var/log/nginx/access.log
    state: present
    name: nginx-access-log

- name: Stop tracking nginx logs
  community.general.logentries:
    path: /var/log/nginx/error.log
    state: absent

作者

  • Ivan Vanderbyl (@ivanvanderbyl)