Skip to content

Deploy mattermost-docker with Ansible on an existing server

License

Notifications You must be signed in to change notification settings

PrivacyLx/ansible-role-mattermost-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-role-mattermost-docker

Deploy mattermost/docker (team edition) with Ansible on an existing server.

Setup instructions are adapted from https://docs.mattermost.com/install/install-docker.html

Table of contents

Use case for this role

Use this role if you want to deploy Mattermost in docker on an existing server. It automatically configures a reverse proxy and HTTPS certificates.

Supported systems

Currently only Debian systems are supported.

Requirements

The following packages are must be installed

  • docker.io
  • docker-compose
  • git

Example playbooks

Installing Mattermost

---
- name: Install Mattermost
  hosts: mattermost
  become: yes
  pre_tasks:
    - name: Install packages
      apt:
        name:
          - docker.io
          - docker-compose
          - git
  roles:
    - role: mattermost
      vars:
        mattermost_docker_install: yes

After the installation has finished, go to your freshly installed Mattermost in a browser and create the first user and team and also set the Site-URL. Changing the Site-URL requires a restart. An example playbook for restarting Mattermost is provided below.

---
- name: Restart Mattermost
  hosts: mattermost
  become: yes
  roles:
    - role: mattermost
      vars:
        mattermost_docker_restart: yes

Upgrading Mattermost to a newer version

Uprades are done rebuilding the images from a new version of mattermost/docker. The example playbook below creates a backup at {{ mattermost_docker_postgres_database }}/backups of you volumes and upgrades the Mattermost installation to mattermost_docker_version. The backups are not deleted automatically.

---
- name: Upgrade Mattermost
  hosts: mattermost
  become: true
  roles:
    - role: ansible-mattermost-docker
      vars:
        mattermost_docker_install: true
        mattermost_docker_upgrade: true
        mattermost_docker_version: 5.4.0

Variables

The following variables are used by the role:

mm_docker_install_path: /opt/mattermost
mm_timezone: "UTC"
mattermost_docker_upgrade: false
mattermost_docker_install: false

# override these with vars from a vault
mm_postgres_user: mattermost
mm_postgres_pass: secure

# set an email for being contacted about
lets_encrypt_email: admin@example.com

About

Deploy mattermost-docker with Ansible on an existing server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jinja 94.1%
  • Python 5.9%