import du dossier ansible

This commit is contained in:
2020-04-19 03:28:50 +02:00
parent 8cce13d9e4
commit 534737fd56
21 changed files with 974 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
Install Mattermost
==================
Make install of Mattermost for Debian Buster.
Postgresql for database.
Install certbot by default, see main.yml in defaults for desactive.

View File

@@ -0,0 +1,10 @@
---
requredPackages:
- gnupg
- curl
- sudo
mattermost_version: 5.21.0
mattermost_user: mmuser

View File

@@ -0,0 +1,41 @@
---
- name: Download binary from MatterMost website
get_url:
url: https://releases.mattermost.com/{{ mattermost_version }}/mattermost-{{ mattermost_version }}-linux-amd64.tar.gz
dest: /tmp/
- name: unpack mattermost archive
unarchive:
src: /tmp/mattermost-team-{{ mattermost_version }}-linux-amd64.tar.gz
dest: /opt/
copy: no
args:
creates: /opt/mattermost/bin/platform
- name: Edit /opt/mattermost/config/config.json
lineinfile:
dest: /opt/mattermost/config/config.json
regexp: '"DriverName": "mysql",'
line: ' "DriverName": "postgres",'
backrefs: yes
- name: Edit /opt/mattermost/config/config.json
lineinfile:
dest: /opt/mattermost/config/config.json
regexp: '"DataSource":'
line: ' "DataSource": "postgres://{{ db_user }}:{{ db_password }}@127.0.0.1:5432/{{ db_name }}?sslmode=disable&connect_timeout=10",'
backrefs: yes
- name: Create mattermost user
user:
name: "{{ mattermost_user }}"
system: yes
createhome: no
- name: Change mattermost directory permissions
file:
path: /opt/mattermost
state: directory
owner: "{{ mattermost_user }}"
group: "{{ mattermost_user }}"
recurse: yes