Skip to content

Author: johnthompson365

Ansible and Windows a match made in…

…Windows Subsystem for Linux Heaven?

My creative colleague Christian Johannsen has developed an amazing script to deploy a demo environment of Mattermost with two of our DevOps integrations the Jira and Jenkins plugin. He hopes to open source the repo at some point.

It uses terraform to deploy the environment in AWS, bash and python scripts to configure the services and an Ansible playbook for the Jenkins install.

Christian created the instructions to run all the scripts but these were for Mac. I’m a rare breed at Mattermost as I am a Windows user so I had to go through the environment setup myself and modify it for Windows.

I was aiming to run this all natively in Windows or at least in Git Bash but got beaten in the end by Ansible. As they point out Ansible cannot run on a Windows host natively, though it can run under the Windows Subsystem for Linux (WSL). They then go on to say that they do not support the WSL and it shouldn’t be used in production.

Installing WSL on Windows 10
Installing Ansible on WSL

I raised  a query on the Ansible Google forum and a helpful Redhat engineer stated that there are also no plans to support this natively on Windows. “It will work but in the odd case it doesn’t you won’t get any help from GitHub unless you can replicate it on an actual Linux platform.”

So it looks like Windows is an outlier in the Ansible world. Just like me and my Surface Laptop at Mattermost!

intro to the mattermost CLI

At work we have been building out our demo environments and looking to create a re-usable Github repo for deploying and configuring Mattermost. The aim is to automate as much as possible of the mattermost deployment. Mattermost can be configured using the API or the CLI. These are my adventures with the CLI….

The updates from the CLI are automatically written to the config.json. There are some considerations when changing settings:

  • Dotted Notation: you have to put the section of json file ahead of the config setting. Shown below as TeamSettings.ExperimentalDefaultChannels
  • Arrays: CLI accepts multiple values for array settings. In the example as Public-Channel01 PublicChannel-02
"ExperimentalDefaultChannels": []

sudo ./mattermost config set TeamSettings.ExperimentalDefaultChannels Public-Channel01 PublicChannel-02

"ExperimentalDefaultChannels": [
    "Public-Channel01",
    "PublicChannel-02"
]

I’ll will add to this post over time so it is a resource to keep coming back to.

But for now this is the story so far…

/remind me

My memory is not my strongest quality somebody told me once, I forget who.

To help with this Mattermost has a /remind plugin developed by a member of the Mattermost community Scott Davis. This can be really useful as a prompt for your forgetful self or a friendly nudge to @co-worker. If you want to see your options then type:

/remind help

If you want to make sure meeting notes get sent out after your call…

When you receive a notification you get prompted by the Remindbot with a new message in your UNREADS

You have options to complete or delete, and can even reschedule the reminder

To install the plugin go to https://integrations.mattermost.com and search for remind or go to the GitHub page.

A simple productivity tip to help you in your day.