diff --git a/playbooks/slack.yaml b/playbooks/slack.yaml new file mode 100644 index 0000000..244e599 --- /dev/null +++ b/playbooks/slack.yaml @@ -0,0 +1,29 @@ +--- +- name: Set up slack + hosts: localhost + vars: + uid: "{{ lookup('env','USER') }}" + slack_version: "{{ lookup('ansible.builtin.pipe','../scripts/get_slack_version.sh') }}" + connection: local + become: false + tasks: + - name: Have slack allready installed + stat: + path: /usr/bin/slack + register: have_slack + - name: Install slack package + become: true + ansible.builtin.apt: + deb: https://downloads.slack-edge.com/releases/linux/{{ slack_version }}/prod/x64/slack-desktop-{{ slack_version }}-amd64.deb + when: not have_slack.stat.exists + - name: set up local desktop dir + ansible.builtin.file: + dest: /home/{{ uid }}/.local/share/applications + state: directory + - name: set up better desktop file + ansible.builtin.template: + src: ../templates/slack.desktop.j2 + dest: /home/{{ uid }}/.local/share/applications/slack.desktop + owner: '{{ uid }}' + group: '{{ uid }}' + mode: '0644' diff --git a/scripts/get_slack_version.sh b/scripts/get_slack_version.sh new file mode 100755 index 0000000..be67425 --- /dev/null +++ b/scripts/get_slack_version.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +curl -s https://slack.com/release-notes/linux \ + | grep -E '