Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions playbooks/roles/mattermost/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ MATTERMOST_HOSTNAME: "{{ inventory_hostname }}"
MATTERMOST_OPS_EMAIL: [email protected]

MATTERMOST_VERSION: 5.8.0
MATTERMOST_UNLINK_VERSION: 0.3.0
# UNLINK is the autolink plugin which converts JIRA tickets to clickable URL
# https://github.com/mattermost/mattermost-plugin-autolink/releases/
MATTERMOST_UNLINK_VERSION: 1.0.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SSPJ, the latest version is 1.1.0 and I installed that version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgp171188 Right, this PR isn't for merging; I just pushed it so that you would have something to look at. I should have made that clear in the description, sorry!


# Restrict registration to email addresses in this domain
MATTERMOST_RESTRICT_TO_EMAIL_DOMAIN: example.com
Expand Down Expand Up @@ -55,7 +57,7 @@ MATTERMOST_INSTALL_TAG_FILE: "{{ MATTERMOST_STATUS_DIR }}/installation-complete"
MATTERMOST_DOWNLOAD_URL: "https://releases.mattermost.com/{{ MATTERMOST_VERSION }}/mattermost-team-{{ MATTERMOST_VERSION }}-linux-amd64.tar.gz"
MATTERMOST_DOWNLOAD_DEST: "/tmp/{{ MATTERMOST_DOWNLOAD_URL|basename }}"

MATTERMOST_UNLINK_DOWNLOAD_URL: "https://github.com/mattermost/mattermost-plugin-autolink/releases/download/v{{ MATTERMOST_UNLINK_VERSION }}/mattermost-plugin-autolink-linux-amd64.tar.gz"
MATTERMOST_UNLINK_DOWNLOAD_URL: "https://github.com/mattermost/mattermost-plugin-autolink/releases/download/v{{ MATTERMOST_UNLINK_VERSION }}/mattermost-autolink-{{ MATTERMOST_UNLINK_VERSION }}.tar.gz"
MATTERMOST_UNLINK_DOWNLOAD_DEST: "/tmp/{{ MATTERMOST_UNLINK_DOWNLOAD_URL|basename }}"

MATTERMOST_CONFIG_FILE: "{{ MATTERMOST_STATUS_DIR }}/config.json"
6 changes: 5 additions & 1 deletion playbooks/roles/mattermost/tasks/mattermost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@
group: mattermost
force: no

# This autolink configuration is NOT used UNLESS you are installing MM from scratch.
# You must MANUALLY copy it from /var/lib/mattermost/autolink.json to the correct place
# in /var/lib/mattermost/config.json and restart MM.
# This is explained in autolink.json.j2 but repeated here to be helpful.
- name: generate autolink configuration
template:
src: autolink.json.j2
dest: "{{ MATTERMOST_CONFIG_FILE|dirname }}/autolink.json"
dest: "{{ MATTERMOST_STATUS_DIR }}/autolink.json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SSPJ, this wasn't needed when I did the upgrade and the auto-linking works okay. So is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's just reducing some code complexity: MATTERMOST_CONFIG_FILE is "{{ MATTERMOST_STATUS_DIR }}/config.json" and so MATTERMOST_CONFIG_FILE|dirname is just MATTERMOST_STATUS_DIR.

owner: mattermost
group: mattermost

Expand Down
4 changes: 0 additions & 4 deletions playbooks/roles/mattermost/templates/autolink.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
{
"Pattern": "(?P<project>{{ project }})-(?P<id>\\d{1,6})(?P<comma>[,;]*)",
"Template": "[${project}-${id}](https://{{ domain.domain }}/browse/${project}-${id})${comma}"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SSPJ, I didn't see any issues with this pattern. Is there a reason for removing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember why I took it out, sorry.

{
"Pattern": "https://{{ domain.domain }}/browse/(?P<project>{{ project }})-(?P<id>\\d{1,6})(?P<query>\\?\\S*\\w)?",
"Template": "[${project}-${id}](https://{{ domain.domain }}/browse/${project}-${id}${query})"
}{{ "," if not (loop.last and domain_loop.last) else "" }}
{% endfor %}
{% endfor %}
Expand Down