community.general.hipchat 模块 – 发送消息到 Hipchat

注意

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

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

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

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

已弃用

在以下版本中移除:

版本 11.0.0

原因:

hipchat 服务已停止,自托管变体自 2020 年起已停止使用。

替代方案:

没有。

概要

  • 向 Hipchat 房间发送消息,并可以选择控制格式。

参数

参数

注释

api

字符串

如果使用自托管 hipchat 服务器,则使用 API url。对于 Hipchat API 版本 2,请使用默认 URI,其中 /v2 而不是 /v1

默认值: "https://api.hipchat.com/v1"

color

字符串

消息的背景颜色。

选择

  • "yellow" ←(默认)

  • "red"

  • "green"

  • "purple"

  • "gray"

  • "random"

msg

字符串 / 必需

消息正文。

msg_format

字符串

消息格式。

选择

  • "text" ←(默认)

  • "html"

msg_from

别名:from

字符串

消息将显示的发送者名称。最大长度为 15 个字符 - 超过此长度将被截断。

默认值: "Ansible"

notify

布尔值

如果为 true,将为房间中的用户触发通知。

选择

  • false

  • true ←(默认)

room

字符串 / 必需

房间的 ID 或名称。

token

字符串 / 必需

API 令牌。

validate_certs

布尔值

如果为 false,则不会验证 SSL 证书。这应该只在个人控制的使用自签名证书的站点上使用。

选择

  • false

  • true ←(默认)

属性

属性

支持

描述

check_mode

支持: 完全

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

diff_mode

支持:

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

示例

- name: Send a message to a Hipchat room
  community.general.hipchat:
    room: notif
    msg: Ansible task finished

- name: Send a message to a Hipchat room using Hipchat API version 2
  community.general.hipchat:
    api: https://api.hipchat.com/v2/
    token: OAUTH2_TOKEN
    room: notify
    msg: Ansible task finished

状态

  • 此模块将在版本 11.0.0 中删除。 [已弃用]

  • 有关更多信息,请参阅 已弃用

作者

  • Shirou Wakayama (@shirou)

  • Paul Bourdel (@pb8226)