Mattermost Setup¶
Configuration Setting | Mandatory? | Default | Available on Admin Config |
---|---|---|---|
enable_mattermost |
Yes | False | Yes |
mattermost_api_token |
Yes | -- | No |
mattermost_url |
Yes | -- | No |
- Login to your instance of Mattermost and select Integrations, then click Bot Accounts.
- Enter the bot username, icon, Display name and Description.
- Choose the Role for the bot. In order to use Ephemeral posts, you need to choose System Admin.
- Configure the displayed Access Token string as the
mattermost_api_token
in your.creds.env
file or directly in thePLUGINS_CONFIG
section ofnautobot_config.py
. It can't be recovered later, so if you lose it you'll need to log in and regenerate a new token. - Go back to Integrations, then click Slash Commands.
- Click Add Slash Command, filling out the Title, Description, Command Trigger Word
- Set the Request URL to
https://<server>/api/plugins/chatops/mattermost/slash_command/
- Click Save.
- Configure the displayed Token following the guide for Add Command Token to database below.
- The Command will be
Command Trigger Word
from step 3. - Use the token displayed from step 3; you can access this token from Mattermost at any time.
- Configure
mattermost_url
with the URL for your Mattermost instance. - To get this from within the client go to the Server Management:
- From Windows
file - settings
- From Mac
Mattermost - preferences
- From Windows
- Copy the displayed url matching the Server you want to add the chatbot to.
- Make sure to include the
http://
orhttps://
. - If shown, make sure to include the port. Ex.
https://example.com:8065
- Make sure to include the
- Proceed to the Install Guide section.
Note: For every Slash Command created for Mattermost, a separate token will be generated.
Add Command Token to Database¶
Nautobot provides an HTTP endpoint(s) for each supported chat platform.
These endpoints implement authentication to prevent arbitrary HTTP requests from being accepted.
Some platforms this signing_secret
is valid for all commands, other platforms, such as Mattermost,
create a separate token
for every slash command. Keeping the records for Mattermost tokens in the
.creds.env
file would not be sustainable.
To solve this issue, the app has the option to store Command Tokens to the Nautobot Database. In Nautobot, open Nautobot and go to the Plugins and select Command Tokens. Below is an example to get you started.
Example: Adding tokens for Mattermost¶
Here is an example that supports Mattermost.
Platform | Comment | Token |
---|---|---|
Mattermost | nautobot |
x0xb5hj5ga5tge |
Mattermost | clear |
x7g7ag9ohkafbe |
Note: The Comment field is optional and used to help the user when there are multiple tokens.
General Chat Setup Instructions¶
See admin_install instructions here for general app setup instructions.