community.general.monit 模块 – 通过 Monit 管理程序状态

注意

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

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

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

要在剧本中使用它,请指定: community.general.monit

概要

  • 通过 Monit 管理受监控程序的状态。

参数

参数

注释

name

字符串 / 必需

要管理的 monit 程序/进程的名称。

state

字符串 / 必需

服务的狀態。

选项

  • "present"

  • "started"

  • "stopped"

  • "restarted"

  • "monitored"

  • "unmonitored"

  • "reloaded"

timeout

整数

如果 monit 监控的服务有待处理的操作,则 Ansible 将最多检查这么多秒以验证已执行请求的操作。Ansible 将在每次检查之间休眠五秒钟。

默认值: 300

属性

属性

支持

描述

check_mode

支持:完全支持

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

diff_mode

支持:不支持

处于 diff 模式时,将返回有关更改内容(或可能需要在 check_mode 中进行更改)的详细信息。

示例

- name: Manage the state of program httpd to be in started state
  community.general.monit:
    name: httpd
    state: started

作者

  • Darryl Stoflet (@dstoflet)

  • Simon Kelly (@snopoke)