parent
1d6e9fa06f
commit
07902c3067
@ -0,0 +1,48 @@
|
|||||||
|
---
|
||||||
|
- name: Set up mattermost
|
||||||
|
hosts: localhost
|
||||||
|
vars:
|
||||||
|
uid: "{{ lookup('env','USER') }}"
|
||||||
|
mattermost_url: "{{ lookup('ansible.builtin.pipe','../scripts/get_mattermost_url.sh') }}"
|
||||||
|
connection: local
|
||||||
|
become: false
|
||||||
|
tasks:
|
||||||
|
- name: Have mattermost allready installed
|
||||||
|
stat:
|
||||||
|
path: /usr/local/bin/mattermost
|
||||||
|
register: have_mattermost
|
||||||
|
- name: Download mattermost package
|
||||||
|
ansible.builtin.command:
|
||||||
|
chdir: /tmp
|
||||||
|
cmd: wget "{{ mattermost_url }}" -O mattermost.tar.gz
|
||||||
|
when: not have_mattermost.stat.exists
|
||||||
|
- name: Unpack mattermost package
|
||||||
|
ansible.builtin.command:
|
||||||
|
chdir: /tmp
|
||||||
|
cmd: tar -xzf mattermost.tar.gz
|
||||||
|
when: not have_mattermost.stat.exists
|
||||||
|
- name: Install mattermost package to /opt/mattermost
|
||||||
|
ansible.builtin.command:
|
||||||
|
chdir: /tmp
|
||||||
|
cmd: bash -c "mv mattermost-desktop-* /opt/mattermost-desktop"
|
||||||
|
become: true
|
||||||
|
when: not have_mattermost.stat.exists
|
||||||
|
- name: install mattermost desktop link
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: /opt/mattermost-desktop/mattermost-desktop
|
||||||
|
dest: /usr/local/bin/mattermost-desktop
|
||||||
|
state: link
|
||||||
|
become: true
|
||||||
|
when: not have_mattermost.stat.exists
|
||||||
|
- name: install mattermost desktop file
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: ../templates/mattermost-desktop.desktop.j2
|
||||||
|
dest: /home/{{ uid }}/.local/share/applications/mattermost-desktop.desktop
|
||||||
|
owner: '{{ uid }}'
|
||||||
|
group: '{{ uid }}'
|
||||||
|
mode: '0644'
|
||||||
|
when: not have_mattermost.stat.exists
|
||||||
|
- name: cleanup
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: rm /tmp/mattermost.tar.gz
|
||||||
|
when: not have_mattermost.stat.exists
|
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
curl -s https://api.github.com/repos/mattermost/desktop/releases/latest \
|
||||||
|
| grep "browser_download_url.*tar.gz" \
|
||||||
|
| cut -d : -f 2,3 \
|
||||||
|
| tr -d \" \
|
||||||
|
| tr -d " " \
|
||||||
|
| grep x64
|
@ -0,0 +1,11 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=mattermost
|
||||||
|
StartupWMClass=Mattermost
|
||||||
|
Comment=Mattermost Desktop
|
||||||
|
GenericName=Mattermost Client for Linux
|
||||||
|
Exec=/usr/local/bin/mattermost-desktop -ozone-platform=wayland --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer %U
|
||||||
|
Icon=/opt/mattermost-desktop/app_icon.png
|
||||||
|
Type=Application
|
||||||
|
StartupNotify=true
|
||||||
|
Categories=GNOME;GTK;Network;InstantMessaging;
|
||||||
|
MimeType=x-scheme-handler/mattermost;
|
Loading…
Reference in new issue