Skip to main content

Role to manage Mattermost

main

Deploys Mattermost Operator and Mattermost CRD.

ensure-team

Creates a Mattermost team.

Requires vars:

Variable nameDescription
mm_admin_tokenAdmin token, needs permissions to manage teams
mm_team_nameName of team
mm_team_display_name(Optional) display name of team

Sets facts:

  • mm_team_id

ensure-channel

Creates a Mattermost channel.

Requires vars:

Variable nameDescription
mm_admin_tokenAdmin token, needs permissions to manage channels
mm_team_idId of team the channel will be created in
mm_channel_nameName of channel
mm_channel_display_name(Optional) display name of channel

Sets facts:

  • mm_channel_id

ensure-webhook

Creates a Mattermost webhook.

Requires vars:

Variable nameDescription
mm_admin_tokenAdmin token, needs permissions to manage webhooks
mm_channel_idId of channel the webhook will post in

Sets facts:

  • mm_webhook_id

ensure-admin

Creates a Mattermost admin user.

Requires vars:

Variable nameDescription
mm_admin_emailAdmin user email
mm_admin_nameAdmin user name
mm_admin_passwordAdmin user password

By default, Mattermost requires certain characters to be included in a password. A random password can be created with:

mm_admin_password: "{{ lookup('community.general.random_string', min_lower=1, min_upper=1, min_numeric=1, min_special=1, override_special='!#$%&()*+,-./:;<=>?@[]^_`|~', length=12) }}"

ensure-user

Creates a Mattermost (non-admin) user.

Requires vars:

Variable nameDescription
mm_user_emailUser email
mm_user_nameUser name
mm_user_passwordUser password

ensure-token

Creates a Mattermost user token. User can either be "regular" or "admin".

Requires vars:

Variable nameDescription
mm_user_nameUser name
mm_token_nameToken name

Sets facts:

  • mm_token