community.general.jabber 模块 – 向 Jabber 用户或聊天室发送消息
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible 包,您可能已经安装了这个集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。您需要进一步的要求才能使用此模块,有关详细信息,请参阅 要求。
要在 playbook 中使用它,请指定:community.general.jabber。
概要
- 向 Jabber 发送消息 
要求
以下要求需要在执行此模块的主机上满足。
- python xmpp (xmpppy) 
参数
| 参数 | 注释 | 
|---|---|
| 消息编码 | |
| 要连接的主机,覆盖用户信息 | |
| 消息正文。 | |
| 用户连接的密码 | |
| 要连接的端口,覆盖默认值 默认值:  | |
| 用户 ID 或房间名称,使用房间时,请使用斜杠指示您的昵称。 | |
| 要连接的用户 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持: 完整 | 可以在  | |
| 支持: 无 | 当处于 diff 模式时,将返回有关已更改(或可能需要在  | 
示例
- name: Send a message to a user
  community.general.jabber:
    user: [email protected]
    password: secret
    to: [email protected]
    msg: Ansible task finished
- name: Send a message to a room
  community.general.jabber:
    user: [email protected]
    password: secret
    to: [email protected]/ansiblebot
    msg: Ansible task finished
- name: Send a message, specifying the host and port
  community.general.jabber:
    user: [email protected]
    host: talk.example.net
    port: 5223
    password: secret
    to: [email protected]
    msg: Ansible task finished
