community.general.matrix (8.5.0) — module

Send notifications to matrix

Authors: Jan Christian Grünhage (@jcgruenhage)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module sends html formatted notifications to matrix rooms.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Send matrix notification with token
  community.general.matrix:
    msg_plain: "**hello world**"
    msg_html: "<b>hello world</b>"
    room_id: "!12345678:server.tld"
    hs_url: "https://matrix.org"
    token: "{{ matrix_auth_token }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Send matrix notification with user_id and password
  community.general.matrix:
    msg_plain: "**hello world**"
    msg_html: "<b>hello world</b>"
    room_id: "!12345678:server.tld"
    hs_url: "https://matrix.org"
    user_id: "ansible_notification_bot"
    password: "{{ matrix_auth_password }}"

Inputs

    
token:
    description:
    - Authentication token for the API call. If provided, user_id and password are not
      required
    type: str

hs_url:
    description:
    - URL of the homeserver, where the CS-API is reachable
    required: true
    type: str

room_id:
    description:
    - ID of the room to send the notification to
    required: true
    type: str

user_id:
    description:
    - The user id of the user
    type: str

msg_html:
    description:
    - HTML form of the message to send to matrix
    required: true
    type: str

password:
    description:
    - The password to log in with
    type: str

msg_plain:
    description:
    - Plain text form of the message to send to matrix, usually markdown
    required: true
    type: str