From 17b4ed6ef6e52c26f9fc77edcd77d629ea192b0c Mon Sep 17 00:00:00 2001 From: Rene Date: Thu, 25 Feb 2021 09:37:42 +0100 Subject: [PATCH] weitere Aenderungen --- .../TUXEDO-Book-XP1511.universe.local.yml | 1 + host_vars/coruscant.universe.local.yml | 13 +- host_vars/endor.universe.local.yml | 1 + host_vars/endorvm.universe.local.yml | 1 + roles/base/tasks/software/nvidia.yml | 24 +++ .../{users => }/software/packages_cleanup.yml | 0 roles/base/tasks/software/utils.yml | 34 ++++ roles/base/tasks/software/zsh.yml | 13 ++ .../tasks/{users => }/system_setup/clock.yml | 0 roles/base/tasks/system_setup/locale.yml | 25 +++ roles/base/tasks/system_setup/openssh.yml | 23 +++ roles/base/vars/zsh.yml | 0 .../workstation/tasks/software/audacious.yml | 8 + roles/workstation/tasks/software/audacity.yml | 8 + roles/workstation/tasks/software/authy.yml | 24 +++ .../workstation/tasks/software/bitwarden.yml | 8 + roles/workstation/tasks/software/boto.yml | 7 + roles/workstation/tasks/software/caffeine.yml | 6 + roles/workstation/tasks/software/chromium.yml | 21 +++ roles/workstation/tasks/software/codecs.yml | 6 + .../workstation/tasks/software/darktable.yml | 8 + roles/workstation/tasks/software/firefox.yml | 8 + roles/workstation/tasks/software/foliate.yml | 8 + roles/workstation/tasks/software/glimpse.yml | 8 + .../tasks/software/google_chrome.yml | 22 +++ roles/workstation/tasks/software/kdenlive.yml | 16 ++ .../workstation/tasks/software/keepassxc.yml | 37 +++++ .../tasks/software/libreoffice.yml | 8 + .../workstation/tasks/software/linode-cli.yml | 7 + roles/workstation/tasks/software/lutris.yml | 20 +++ .../workstation/tasks/software/mattermost.yml | 18 +++ .../workstation/tasks/software/minecraft.yml | 8 + .../workstation/tasks/software/misc_games.yml | 13 ++ .../tasks/software/misc_packages.yml | 71 ++++++++ roles/workstation/tasks/software/openshot.yml | 7 + roles/workstation/tasks/software/packer.yml | 9 ++ roles/workstation/tasks/software/signal.yml | 18 +++ roles/workstation/tasks/software/solaar.yml | 10 ++ roles/workstation/tasks/software/spotify.yml | 8 + roles/workstation/tasks/software/steam.yml | 89 ++++++++++ .../workstation/tasks/software/syncthing.yml | 153 ++++++++++++++++++ .../workstation/tasks/software/terraform.yml | 9 ++ .../tasks/software/thunderbird.yml | 18 +++ roles/workstation/tasks/software/todoist.yml | 23 +++ .../workstation/tasks/software/ulauncher.yml | 32 ++++ roles/workstation/tasks/software/vagrant.yml | 11 ++ .../workstation/tasks/software/virtualbox.yml | 32 ++++ roles/workstation/tasks/software/vivaldi.yml | 36 +++++ roles/workstation/tasks/software/vlc.yml | 10 ++ roles/workstation/tasks/software/xonotic.yml | 10 ++ 50 files changed, 946 insertions(+), 4 deletions(-) create mode 100644 roles/base/tasks/software/nvidia.yml rename roles/base/tasks/{users => }/software/packages_cleanup.yml (100%) create mode 100644 roles/base/tasks/software/utils.yml create mode 100644 roles/base/tasks/software/zsh.yml rename roles/base/tasks/{users => }/system_setup/clock.yml (100%) create mode 100644 roles/base/tasks/system_setup/locale.yml create mode 100644 roles/base/tasks/system_setup/openssh.yml create mode 100644 roles/base/vars/zsh.yml create mode 100644 roles/workstation/tasks/software/audacious.yml create mode 100644 roles/workstation/tasks/software/audacity.yml create mode 100644 roles/workstation/tasks/software/authy.yml create mode 100644 roles/workstation/tasks/software/bitwarden.yml create mode 100644 roles/workstation/tasks/software/boto.yml create mode 100644 roles/workstation/tasks/software/caffeine.yml create mode 100644 roles/workstation/tasks/software/chromium.yml create mode 100644 roles/workstation/tasks/software/codecs.yml create mode 100644 roles/workstation/tasks/software/darktable.yml create mode 100644 roles/workstation/tasks/software/firefox.yml create mode 100644 roles/workstation/tasks/software/foliate.yml create mode 100644 roles/workstation/tasks/software/glimpse.yml create mode 100644 roles/workstation/tasks/software/google_chrome.yml create mode 100644 roles/workstation/tasks/software/kdenlive.yml create mode 100644 roles/workstation/tasks/software/keepassxc.yml create mode 100644 roles/workstation/tasks/software/libreoffice.yml create mode 100644 roles/workstation/tasks/software/linode-cli.yml create mode 100644 roles/workstation/tasks/software/lutris.yml create mode 100644 roles/workstation/tasks/software/mattermost.yml create mode 100644 roles/workstation/tasks/software/minecraft.yml create mode 100644 roles/workstation/tasks/software/misc_games.yml create mode 100644 roles/workstation/tasks/software/misc_packages.yml create mode 100644 roles/workstation/tasks/software/openshot.yml create mode 100644 roles/workstation/tasks/software/packer.yml create mode 100644 roles/workstation/tasks/software/signal.yml create mode 100644 roles/workstation/tasks/software/solaar.yml create mode 100644 roles/workstation/tasks/software/spotify.yml create mode 100644 roles/workstation/tasks/software/steam.yml create mode 100644 roles/workstation/tasks/software/syncthing.yml create mode 100644 roles/workstation/tasks/software/terraform.yml create mode 100644 roles/workstation/tasks/software/thunderbird.yml create mode 100644 roles/workstation/tasks/software/todoist.yml create mode 100644 roles/workstation/tasks/software/ulauncher.yml create mode 100644 roles/workstation/tasks/software/vagrant.yml create mode 100644 roles/workstation/tasks/software/virtualbox.yml create mode 100644 roles/workstation/tasks/software/vivaldi.yml create mode 100644 roles/workstation/tasks/software/vlc.yml create mode 100644 roles/workstation/tasks/software/xonotic.yml diff --git a/host_vars/TUXEDO-Book-XP1511.universe.local.yml b/host_vars/TUXEDO-Book-XP1511.universe.local.yml index 454285c..1c321ae 100644 --- a/host_vars/TUXEDO-Book-XP1511.universe.local.yml +++ b/host_vars/TUXEDO-Book-XP1511.universe.local.yml @@ -56,6 +56,7 @@ libreoffice: true midnightcommander: true nextcloud_client: true nvidia: true +obs: true pacaur: true ranger: true syncthing: true diff --git a/host_vars/coruscant.universe.local.yml b/host_vars/coruscant.universe.local.yml index 110972e..0891e02 100644 --- a/host_vars/coruscant.universe.local.yml +++ b/host_vars/coruscant.universe.local.yml @@ -10,17 +10,23 @@ ssh_users: "root rene" microcode_amd_install: false microcode_intel_install: true -#purpose selection +# purpose selection database: true +mysql: true +postgresql: false dhcpserver: true fileserver: true mailserver: true nameserver: true printspooler: true proxyserver: true +squid: false +tinyproxy: true webserver: true +apache: true +nginx: true -#application selection +# application selection borgbackup: true broot: true docker: false @@ -31,6 +37,5 @@ syncthing: true vifm: true yay: false -#shell selection +# shell selection zsh: true - diff --git a/host_vars/endor.universe.local.yml b/host_vars/endor.universe.local.yml index 5c05077..4ba4a90 100644 --- a/host_vars/endor.universe.local.yml +++ b/host_vars/endor.universe.local.yml @@ -20,6 +20,7 @@ libreoffice: true midnightcommander: true nextcloud_client: true nvidia: true +obs: true pacaur: true ranger: true syncthing: true diff --git a/host_vars/endorvm.universe.local.yml b/host_vars/endorvm.universe.local.yml index 0549d58..88246a4 100644 --- a/host_vars/endorvm.universe.local.yml +++ b/host_vars/endorvm.universe.local.yml @@ -28,6 +28,7 @@ libreoffice: true midnightcommander: true nextcloud_client: true nvidia: true +obs: true pacaur: true ranger: true syncthing: true diff --git a/roles/base/tasks/software/nvidia.yml b/roles/base/tasks/software/nvidia.yml new file mode 100644 index 0000000..947b55d --- /dev/null +++ b/roles/base/tasks/software/nvidia.yml @@ -0,0 +1,24 @@ +- name: system setup | GPU | NVidia + tags: gpu,nvidia,systemsetup + package: + state: latest + name: + - cuda + - nvidia + - nvidia-settings + - nvidia-utils + - nvtop + when: nvidia is defined and nvidia == true + +- name: system setup | GPU | NVidia-Prime + tags: gpu,nvidia,prime,system setup + package: + state: latest + name: nvidia-prime + when: + - nvidia is defined + - nvidia == true + - mobile is defined + - mobile == true + - nvidia_prime is defined + - nvidia_prime == true diff --git a/roles/base/tasks/users/software/packages_cleanup.yml b/roles/base/tasks/software/packages_cleanup.yml similarity index 100% rename from roles/base/tasks/users/software/packages_cleanup.yml rename to roles/base/tasks/software/packages_cleanup.yml diff --git a/roles/base/tasks/software/utils.yml b/roles/base/tasks/software/utils.yml new file mode 100644 index 0000000..16b879c --- /dev/null +++ b/roles/base/tasks/software/utils.yml @@ -0,0 +1,34 @@ +- name: system setup | utilities | install utility packages + tags: packages,system,system setup + package: + state: latest + name: + - bashtop + - curl + - exa + - htop + - iftop + - iotop + - "{{ lm_sensors_package }}" + - lsd + - lsof + - neofetch + - net-tools + - "{{ nfs_client_package }}" + - ranger + - rsync + - tmux + - traceroute + - vifm + - "{{ vim_package }}" + - wget + +- name: system setup | utilities | install man-pages (arch) + tags: packages,system,settings + pacman: + state: latest + name: + - man-db + - man-pages + when: ansible_distribution == "Archlinux" + diff --git a/roles/base/tasks/software/zsh.yml b/roles/base/tasks/software/zsh.yml new file mode 100644 index 0000000..482f5aa --- /dev/null +++ b/roles/base/tasks/software/zsh.yml @@ -0,0 +1,13 @@ +- name: system setup | shell | zsh + tags: shell,zsh,system setup + package: + state: latest + name: + - zsh + - zsh-autosuggestions + - zsh-completions + - zsh-history-substring-search + - zsh-lovers + - zsh-syntax-highlighting + - zsh-theme-powerlevel10k + - zshdb diff --git a/roles/base/tasks/users/system_setup/clock.yml b/roles/base/tasks/system_setup/clock.yml similarity index 100% rename from roles/base/tasks/users/system_setup/clock.yml rename to roles/base/tasks/system_setup/clock.yml diff --git a/roles/base/tasks/system_setup/locale.yml b/roles/base/tasks/system_setup/locale.yml new file mode 100644 index 0000000..05d32bc --- /dev/null +++ b/roles/base/tasks/system_setup/locale.yml @@ -0,0 +1,25 @@ +- name: system setup | locale | add de_DE + tags: locale,system,setup + locale_gen: + name: de_DE.UTF-8 + state: present + +- name: system setup | locale | set locale to de_DE + tags: locale,system,setup + locale_gen: + name: de_DE.UTF-8 + state: present + register: locale + +- name: system setup | locale | set de_DE as default locale + tags: locale,system,setup + command: localectl set-locale LANG=de_DE.UTF-8 + when: locale.changed + +- name: system setup | locale | remove en_GB + tags: locale,system,setup + locale_gen: + name: en_GB.UTF-8 + state: absent + when: locale.changed + diff --git a/roles/base/tasks/system_setup/openssh.yml b/roles/base/tasks/system_setup/openssh.yml new file mode 100644 index 0000000..0f0cc0c --- /dev/null +++ b/roles/base/tasks/system_setup/openssh.yml @@ -0,0 +1,23 @@ +- name: system setup | openssh | install or update daemon package + tags: openssh,ssh,system,settings + package: + name: "{{ openssh_package }}" + state: latest + notify: restart_sshd + +- name: system setup | openssh | enable daemon + tags: openssh,ssh,system,settings + service: + name: "{{ openssh_service }}" + enabled: yes + state: started + +- name: system setup | openssh | generate sshd_config file from template + tags: openssh,ssh,system,settings + template: + src: sshd_config.j2 + dest: /etc/ssh/sshd_config + owner: root + group: root + mode: 0644 + notify: restart_sshd diff --git a/roles/base/vars/zsh.yml b/roles/base/vars/zsh.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/workstation/tasks/software/audacious.yml b/roles/workstation/tasks/software/audacious.yml new file mode 100644 index 0000000..caca878 --- /dev/null +++ b/roles/workstation/tasks/software/audacious.yml @@ -0,0 +1,8 @@ +- name: software | audacious | install package + tags: packages,flatpak,audacious,workstation-packages + become_user: jay + flatpak: + name: org.atheme.audacious + method: user + state: present + when: audacious is defined and audacious == true diff --git a/roles/workstation/tasks/software/audacity.yml b/roles/workstation/tasks/software/audacity.yml new file mode 100644 index 0000000..81638b4 --- /dev/null +++ b/roles/workstation/tasks/software/audacity.yml @@ -0,0 +1,8 @@ +- name: software | audacity | install package + tags: packages,flatpak,audacity,workstation-packages + become_user: jay + flatpak: + name: org.audacityteam.Audacity + method: user + state: present + when: audacity is defined and audacity == true diff --git a/roles/workstation/tasks/software/authy.yml b/roles/workstation/tasks/software/authy.yml new file mode 100644 index 0000000..c0a1757 --- /dev/null +++ b/roles/workstation/tasks/software/authy.yml @@ -0,0 +1,24 @@ +# note: snap packages not automated in arch yet, snapd is not available in repo +- name: software | authy | install package + tags: packages,authy,snap,workstation-packages + snap: + name: authy + channel: latest/edge + state: present + when: + - ansible_distribution != "Archlinux" + - authy is defined + - authy == true + +- name: software | authy | enable autostart + tags: packages,authy,snap,workstation-packages + file: + src: /var/lib/snapd/desktop/applications/authy_authy.desktop + dest: /home/jay/.config/autostart/authy.desktop + owner: jay + group: jay + state: link + when: + - ansible_distribution != "Archlinux" + - authy is defined + - authy == true diff --git a/roles/workstation/tasks/software/bitwarden.yml b/roles/workstation/tasks/software/bitwarden.yml new file mode 100644 index 0000000..288e63f --- /dev/null +++ b/roles/workstation/tasks/software/bitwarden.yml @@ -0,0 +1,8 @@ +- name: software | bitwarden | install package + tags: bitwarden,packages,flatpak,workstation-packages + become_user: jay + flatpak: + name: flathub com.bitwarden.desktop + method: user + state: present + when: bitwarden is defined and bitwarden == true diff --git a/roles/workstation/tasks/software/boto.yml b/roles/workstation/tasks/software/boto.yml new file mode 100644 index 0000000..6bfd202 --- /dev/null +++ b/roles/workstation/tasks/software/boto.yml @@ -0,0 +1,7 @@ +- name: software | boto | install package + tags: boto,packages,pip,python + become_user: jay + pip: + executable: /usr/bin/pip3 + state: latest + name: boto diff --git a/roles/workstation/tasks/software/caffeine.yml b/roles/workstation/tasks/software/caffeine.yml new file mode 100644 index 0000000..a7901f6 --- /dev/null +++ b/roles/workstation/tasks/software/caffeine.yml @@ -0,0 +1,6 @@ +# Arch isn't packaging caffeine for some stupid reason. +- name: software | install caffeine + tags: packages,workstation-packages,caffeine + package: + name: caffeine + when: ansible_distribution != "Archlinux" diff --git a/roles/workstation/tasks/software/chromium.yml b/roles/workstation/tasks/software/chromium.yml new file mode 100644 index 0000000..57e8639 --- /dev/null +++ b/roles/workstation/tasks/software/chromium.yml @@ -0,0 +1,21 @@ +# note: snap packages not automated in arch yet, snapd is not available in repo + +- name: software | chromium | install snap package + tags: packages,chromium,snap,workstation-packages + snap: + name: chromium + state: present + when: + - ansible_distribution != "Archlinux" + - chromium is defined + - chromium == true + +- name: software | chromium | install distro package (arch) + tags: packages,chromium,snap,workstation-packages + package: + name: chromium + state: latest + when: + - ansible_distribution == "Archlinux" + - chromium is defined + - chromium == true diff --git a/roles/workstation/tasks/software/codecs.yml b/roles/workstation/tasks/software/codecs.yml new file mode 100644 index 0000000..2fdcb63 --- /dev/null +++ b/roles/workstation/tasks/software/codecs.yml @@ -0,0 +1,6 @@ +- name: software | install multimedia codecs + tags: packages,system,system-packages,workstation-packages + package: + name: + - "{{ gstreamer_libav_package }}" + - "{{ gstreamer_plugins_bad_package }}" diff --git a/roles/workstation/tasks/software/darktable.yml b/roles/workstation/tasks/software/darktable.yml new file mode 100644 index 0000000..8df59e6 --- /dev/null +++ b/roles/workstation/tasks/software/darktable.yml @@ -0,0 +1,8 @@ +- name: software | darktable | install package + tags: packages,flatpak,darktable,workstation-packages + become_user: jay + flatpak: + name: org.darktable.Darktable + method: user + state: present + when: darktable is defined and darktable == true diff --git a/roles/workstation/tasks/software/firefox.yml b/roles/workstation/tasks/software/firefox.yml new file mode 100644 index 0000000..bab9c71 --- /dev/null +++ b/roles/workstation/tasks/software/firefox.yml @@ -0,0 +1,8 @@ +- name: software | firefox | install package + tags: packages,firefox,flatpak,workstation-packages + become_user: jay + flatpak: + name: org.mozilla.firefox + method: user + state: present + when: firefox is defined and firefox == true diff --git a/roles/workstation/tasks/software/foliate.yml b/roles/workstation/tasks/software/foliate.yml new file mode 100644 index 0000000..afa68b5 --- /dev/null +++ b/roles/workstation/tasks/software/foliate.yml @@ -0,0 +1,8 @@ +- name: software | foliate | install package + tags: packages,flatpak,foliate,workstation-packages + become_user: jay + flatpak: + name: com.github.johnfactotum.Foliate + method: user + state: present + when: foliate is defined and foliate == true diff --git a/roles/workstation/tasks/software/glimpse.yml b/roles/workstation/tasks/software/glimpse.yml new file mode 100644 index 0000000..cfb8118 --- /dev/null +++ b/roles/workstation/tasks/software/glimpse.yml @@ -0,0 +1,8 @@ +- name: software | glimpse | install package + tags: packages,flatpak,glimpse,workstation-packages + become_user: jay + flatpak: + name: org.glimpse_editor.Glimpse + method: user + state: present + when: glimpse is defined and glimpse == true diff --git a/roles/workstation/tasks/software/google_chrome.yml b/roles/workstation/tasks/software/google_chrome.yml new file mode 100644 index 0000000..8dddb26 --- /dev/null +++ b/roles/workstation/tasks/software/google_chrome.yml @@ -0,0 +1,22 @@ +- name: software | google-chrome | add repository key + apt_key: + url: https://dl-ssl.google.com/linux/linux_signing_key.pub + when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + +- name: software | google-chrome | add repository + apt_repository: + repo: "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" + filename: google-chrome + register: chrome_repo + when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + +- name: software | google-chrome | update sources (repo added or changed) + apt: + update_cache: yes + changed_when: False + when: chrome_repo.changed + +- name: software | google-chrome | install package + apt: + name: google-chrome-stable + when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] diff --git a/roles/workstation/tasks/software/kdenlive.yml b/roles/workstation/tasks/software/kdenlive.yml new file mode 100644 index 0000000..afcac13 --- /dev/null +++ b/roles/workstation/tasks/software/kdenlive.yml @@ -0,0 +1,16 @@ +- name: software | kdenlive | copy launcher + tags: apps,appimage,software,kdenlive + copy: + src: users/jay/kdenlive.desktop + dest: /home/jay/.local/share/applications/kdenlive.desktop + owner: jay + group: jay + mode: 0700 + +- name: software | kdenlive | install package + get_url: + url: https://download.kde.org/stable/kdenlive/20.08/linux/kdenlive-20.08.2-x86_64.appimage + dest: /home/jay/bin/kdenlive.app + mode: '0700' + owner: jay + group: jay diff --git a/roles/workstation/tasks/software/keepassxc.yml b/roles/workstation/tasks/software/keepassxc.yml new file mode 100644 index 0000000..e028abf --- /dev/null +++ b/roles/workstation/tasks/software/keepassxc.yml @@ -0,0 +1,37 @@ +- name: software | keepassxc | install package + tags: packages,firefox,flatpak,workstation-packages + become_user: jay + flatpak: + name: org.keepassxc.KeePassXC + method: user + state: present + +- name: software | keepassxc | enable autostart + tags: packages,keepassxc,flatpak,workstation-packages + file: + src: /home/jay/.local/share/flatpak/exports/share/applications/org.keepassxc.KeePassXC.desktop + dest: /home/jay/.config/autostart/org.keepassxc.KeePassXC.desktop + owner: jay + group: jay + state: link + +- name: software | keepassxc | create keepassxc install directory + tags: packages,keepassxc,flatpak,workstation-packages + file: + path: /home/jay/.config/keepassxc + state: directory + owner: jay + group: jay + mode: 0700 + register: keepassxc_config_dir + when: keepassxc is defined and keepassxc == true + +- name: software | keepassxc | add initial keepassxc config + tags: packages,keepassxc,flatpak,workstation-packages + copy: + src: users/jay/keepassxc.ini + dest: /home/jay/.config/keepassxc/keepassxc.ini + owner: jay + group: jay + mode: 0600 + when: keepassxc is defined and keepassxc == true diff --git a/roles/workstation/tasks/software/libreoffice.yml b/roles/workstation/tasks/software/libreoffice.yml new file mode 100644 index 0000000..f2fc852 --- /dev/null +++ b/roles/workstation/tasks/software/libreoffice.yml @@ -0,0 +1,8 @@ +- name: software | libreoffice | install package + tags: packages,flatpak,libreoffice,workstation-packages + become_user: jay + flatpak: + name: org.libreoffice.LibreOffice + method: user + state: present + when: libreoffice is defined and libreoffice == true diff --git a/roles/workstation/tasks/software/linode-cli.yml b/roles/workstation/tasks/software/linode-cli.yml new file mode 100644 index 0000000..55944a2 --- /dev/null +++ b/roles/workstation/tasks/software/linode-cli.yml @@ -0,0 +1,7 @@ +- name: software | linode-cli | install package + tags: packages,linode,pip,python + become_user: jay + pip: + executable: /usr/bin/pip3 + state: latest + name: linode-cli diff --git a/roles/workstation/tasks/software/lutris.yml b/roles/workstation/tasks/software/lutris.yml new file mode 100644 index 0000000..c323f80 --- /dev/null +++ b/roles/workstation/tasks/software/lutris.yml @@ -0,0 +1,20 @@ +# As of 2020-06-18, lutris is not available on debian +- name: software | lutris | install ppa + tags: gaming,lutris + apt_repository: + repo: 'ppa:lutris-team/lutris' + state: present + when: + - ansible_distribution in ["Pop!_OS", "Ubuntu"] + - lutris is defined + - lutris == true + +- name: software | lutris | install package + tags: gaming,lutris + package: + state: latest + name: lutris + when: + - ansible_distribution in ["Archlinux", "Pop!_OS", "Ubuntu"] + - lutris is defined + - lutris == true diff --git a/roles/workstation/tasks/software/mattermost.yml b/roles/workstation/tasks/software/mattermost.yml new file mode 100644 index 0000000..0be006f --- /dev/null +++ b/roles/workstation/tasks/software/mattermost.yml @@ -0,0 +1,18 @@ +- name: software | mattermost | install package + tags: packages,flatpak,mattermost,workstation-packages + become_user: jay + flatpak: + name: com.mattermost.Desktop + method: user + state: present + when: mattermost is defined and mattermost == true + +- name: software | mattermost | enable autostart + tags: packages,flatpak,mattermost,workstation-packages + file: + src: /home/jay/.local/share/flatpak/exports/share/applications/com.mattermost.Desktop.desktop + dest: /home/jay/.config/autostart/com.mattermost.Desktop.desktop + owner: jay + group: jay + state: link + when: mattermost is defined and mattermost == true diff --git a/roles/workstation/tasks/software/minecraft.yml b/roles/workstation/tasks/software/minecraft.yml new file mode 100644 index 0000000..e348215 --- /dev/null +++ b/roles/workstation/tasks/software/minecraft.yml @@ -0,0 +1,8 @@ +- name: software | minecraft | install package + tags: packages,flatpak,games,minecraft,workstation-packages + become_user: jay + flatpak: + name: com.mojang.Minecraft + method: user + state: present + when: minecraft is defined and minecraft == true diff --git a/roles/workstation/tasks/software/misc_games.yml b/roles/workstation/tasks/software/misc_games.yml new file mode 100644 index 0000000..fc0b5ae --- /dev/null +++ b/roles/workstation/tasks/software/misc_games.yml @@ -0,0 +1,13 @@ +- name: software | install misc game packages + tags: gaming + package: + name: + - chromium-bsu + - extremetuxracer + - frozen-bubble + - gnome-chess + - "{{ nethack_package }}" + - supertux + - supertuxkart + - wesnoth + when: games is defined and games == true diff --git a/roles/workstation/tasks/software/misc_packages.yml b/roles/workstation/tasks/software/misc_packages.yml new file mode 100644 index 0000000..0751638 --- /dev/null +++ b/roles/workstation/tasks/software/misc_packages.yml @@ -0,0 +1,71 @@ +- name: software | install workstation distribution packages + tags: packages,workstation-packages + package: + name: + - acpid + - alsa-utils + - arandr + - asunder + - cifs-utils + - "{{ cups_package }}" + - "{{ cryptsetup_package }}" + - dconf-editor + - dialog + - easytag + - exfat-utils + - "{{ font_fira_mono_package }}" + - "{{ font_hack_ttf_package }}" + - "{{ font_inconsolata_package }}" + - "{{ font_noto_emoji_package }}" + - "{{ font_terminus_package }}" + - geany + - gparted + - "{{ hunspell_package }}" + - "{{ hyphen_package }}" + - "{{ p7zip_package }}" + - "{{ libnotify_package }}" + - "{{ mpv_package}}" + - "{{ network_manager_openvpn_package }}" + - "{{ network_manager_package }}" + - "{{ network_manager_pptp_package }}" + - "{{ network_manager_vpnc_package }}" + - neovim + - pavucontrol + - shotwell + - simplescreenrecorder + - smbclient + - sshpass + - "{{ ssh_askpass_package }}" + - terminator + - transmission-gtk + - unrar + - "{{ wireless_tools_package }}" + - "{{ wpa_supplicant_package }}" + - x2goclient + +- name: software | install system packages specific to debian and ubuntu + tags: packages,system,system-packages,workstation-packages + package: + name: + - synaptic + - vim-gtk3 + when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + +- name: software | remove unneeded workstation packages on debian and ubuntu hosts + tags: cleanup,packages,workstation-packages + package: + state: absent + name: + - firefox* + - libreoffice-base-core + - libreoffice-calc + - libreoffice-common + - libreoffice-core + - libreoffice-draw + - libreoffice-gnome + - libreoffice-gtk3 + - libreoffice-impress + - libreoffice-math + - libreoffice-writer + - thunderbird* + when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] diff --git a/roles/workstation/tasks/software/openshot.yml b/roles/workstation/tasks/software/openshot.yml new file mode 100644 index 0000000..ff218d3 --- /dev/null +++ b/roles/workstation/tasks/software/openshot.yml @@ -0,0 +1,7 @@ +- name: software | openshot | install package + get_url: + url: https://github.com/OpenShot/openshot-qt/releases/download/v2.5.1/OpenShot-v2.5.1-x86_64.AppImage + dest: /home/jay/bin/openshot.app + mode: '0700' + owner: jay + group: jay diff --git a/roles/workstation/tasks/software/packer.yml b/roles/workstation/tasks/software/packer.yml new file mode 100644 index 0000000..533178d --- /dev/null +++ b/roles/workstation/tasks/software/packer.yml @@ -0,0 +1,9 @@ +- name: software | packer | install binary + unarchive: + src: https://releases.hashicorp.com/packer/{{ packer_version }}/packer_{{ packer_version }}_linux_amd64.zip + dest: /usr/local/bin + remote_src: yes + mode: 0755 + owner: root + group: root + when: packer is defined and packer == true diff --git a/roles/workstation/tasks/software/signal.yml b/roles/workstation/tasks/software/signal.yml new file mode 100644 index 0000000..5903286 --- /dev/null +++ b/roles/workstation/tasks/software/signal.yml @@ -0,0 +1,18 @@ +- name: software | signal | install package + tags: packages,flatpak,signal,workstation-packages + become_user: jay + flatpak: + name: org.signal.Signal + method: user + state: present + when: signal is defined and signal == true + +- name: software | signal | enable autostart + tags: packages,flatpak,signal,workstation-packages + file: + src: /home/jay/.local/share/flatpak/exports/share/applications/org.signal.Signal.desktop + dest: /home/jay/.config/autostart/org.signal.Signal.desktop + owner: jay + group: jay + state: link + when: signal is defined and signal == true diff --git a/roles/workstation/tasks/software/solaar.yml b/roles/workstation/tasks/software/solaar.yml new file mode 100644 index 0000000..4ad8646 --- /dev/null +++ b/roles/workstation/tasks/software/solaar.yml @@ -0,0 +1,10 @@ +- name: software | install workstation distribution packages + tags: packages,workstation-packages + package: + name: solaar + state: latest + +- name: software | make sure solaar doesn't autostart + file: + path: /etc/xdg/autostart/solaar.desktop + state: absent diff --git a/roles/workstation/tasks/software/spotify.yml b/roles/workstation/tasks/software/spotify.yml new file mode 100644 index 0000000..2ed50ed --- /dev/null +++ b/roles/workstation/tasks/software/spotify.yml @@ -0,0 +1,8 @@ +- name: software | spotify | install package + tags: packages,flatpak,spotify,workstation-packages + become_user: jay + flatpak: + name: com.spotify.Client + method: user + state: present + when: spotify is defined and spotify == true diff --git a/roles/workstation/tasks/software/steam.yml b/roles/workstation/tasks/software/steam.yml new file mode 100644 index 0000000..40b2491 --- /dev/null +++ b/roles/workstation/tasks/software/steam.yml @@ -0,0 +1,89 @@ +# For some reason Manjaro is detected as Archlinux +- name: software | steam | check if distribution is manjaro + stat: + path: /usr/bin/manjaro-hello + register: manjaro + when: + - ansible_distribution == "Archlinux" + - steam is defined + - steam == true + +- name: software | steam | steam | enable multilib (arch) + tags: steam,steam,multilib + blockinfile: + state: present + backup: yes + path: /etc/pacman.conf + marker: '# {mark} ANSIBLE MANAGED BLOCK MULTILIB' + block: | + [multilib] + Include = /etc/pacman.d/mirrorlist + register: multilib + when: + - ansible_distribution == "Archlinux" + - manjaro.stat.exists == False + - steam is defined + - steam == true + +- name: software | steam | update cache (multilib added) (arch) + tags: steam,steam,multilib + pacman: update_cache=yes + when: + - multilib.changed + - ansible_distribution == "Archlinux" + +# As of 2020-09-30, multiarch is still required to be enabled in Debian and Ubuntu +# Note: Not required in Pop OS, apparently +- name: steam | add multiarch (debian, ubuntu) + tags: steam,steam,multiarch + lineinfile: + dest: /var/lib/dpkg/arch + regexp: "^i386" + line: "i386" + create: yes + when: + - ansible_distribution in ['Debian', 'Ubuntu'] + - steam is defined + - steam == true + +# For Debian and Ubuntu, set up acceptance of steam license before continuing +- name: software | steam | accept license + tags: gaming,steam + debconf: + name: "steam" + question: "steam/question" + value: "I AGREE" + vtype: "select" + when: + - ansible_distribution in ["Debian", "Ubuntu"] + - steam is defined + - steam == true + +- name: software | steam | install package + tags: steam,steam + package: + state: latest + name: "{{ steam_package }}" + when: + - steam is defined + - steam == true + +- name: software | steam | install steam-devices package (debian, ubuntu, etc) + tags: steam,steam + package: + state: latest + name: steam-devices + when: + - ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + - steam is defined + - steam == true + +- name: install vulkan drivers (debian, ubuntu, etc) + tags: drivers,steam + package: + state: latest + name: mesa-vulkan-drivers + when: + - ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + - steam is defined + - steam == true diff --git a/roles/workstation/tasks/software/syncthing.yml b/roles/workstation/tasks/software/syncthing.yml new file mode 100644 index 0000000..4a4ed69 --- /dev/null +++ b/roles/workstation/tasks/software/syncthing.yml @@ -0,0 +1,153 @@ +# add syncthing-controlled directories +- name: software | syncthing | create directories + tags: syncthing + file: + path: /home/jay/{{ item.dir }} + state: directory + owner: jay + group: jay + mode: 0700 + with_items: + - { dir: bin } + - { dir: desktop } + - { dir: documents } + - { dir: downloads } + - { dir: projects } + - { dir: templates } + when: syncthing is defined and syncthing == true + +- name: software | syncthing | copy .stignore file to synced directories + tags: syncthing + copy: + src: users/jay/stignore + dest: /home/jay/{{ item.dir }}/.stignore + owner: jay + group: jay + mode: 0600 + with_items: + - { dir: bin } + - { dir: desktop } + - { dir: documents } + - { dir: downloads } + - { dir: projects } + - { dir: templates } + when: syncthing is defined and syncthing == true + +# syncthing repository for debian and ubuntu +- name: software | syncthing | install apt key + tags: syncthing + apt_key: + url: https://syncthing.net/release-key.txt + state: present + when: + - ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + - syncthing is defined + - syncthing == true + +- name: software | syncthing | install repository + tags: syncthing + apt_repository: + repo: deb https://apt.syncthing.net/ syncthing stable + state: present + filename: syncthing + when: + - ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + - syncthing is defined + - syncthing == true + +- name: software | syncthing | install syncthing packages + tags: syncthing + package: + name: + - syncthing + #- syncthing-gtk + state: latest + register: syncthing_installed + when: + - syncthing is defined + - syncthing == true + +#- name: software | syncthing | add .desktop file for autostarting syncthing-gtk +# tags: syncthing +# copy: +# src: users/jay/syncthing-gtk.desktop +# dest: /home/jay/.config/autostart/syncthing-gtk.desktop +# owner: jay +# group: jay +# mode: 0600 +# when: +# - syncthing is defined +# - syncthing == true + +#- name: software | syncthing | ensure syncthing-gtk config folder exists +# tags: syncthing +# file: +# path: /home/jay/.config/syncthing-gtk +# state: directory +# owner: jay +# group: jay +# mode: 0700 +# when: +# - syncthing is defined +# - syncthing == true + +#- name: software | syncthing | add initial configuration file for syncthing-gtk +# tags: syncthing +# copy: +# src: users/jay/syncthing_config.json +# dest: /home/jay/.config/syncthing-gtk/config.json +# owner: jay +# group: jay +# mode: 0600 +# when: +# - syncthing is defined +# - syncthing == true + +# Enable and start syncthing +# Note: Not using systemd module because it triggers a dbus error due to no session while user is not logged in +- name: software | syncthing | start and enable syncthing + tags: syncthing + command: "{{ item }}" + with_items: + - systemctl enable syncthing@jay + - systemctl restart syncthing@jay + when: syncthing_installed.changed + +# Adjust configuration file +- name: software | syncthing | pause to ensure config file exists + tags: syncthing + become_user: jay + wait_for: + path: /home/jay/.config/syncthing/config.xml + delay: 10 + when: syncthing_installed.changed + +- name: software | syncthing | config.xml - disable browser + tags: syncthing + become_user: jay + replace: + path: /home/jay/.config/syncthing/config.xml + regexp: "true" + replace: "false" + notify: restart_syncthing + when: + - syncthing is defined + - syncthing == true + +- name: software | syncthing | config.xml - set ui theme + tags: syncthing + become_user: jay + replace: + path: /home/jay/.config/syncthing/config.xml + regexp: "default" + replace: "dark" + notify: restart_syncthing + when: + - syncthing is defined + - syncthing == true + +- name: software | syncthing | remove default sync directory (~/Sync) from host + tags: syncthing + file: + path: /home/jay/Sync + state: absent diff --git a/roles/workstation/tasks/software/terraform.yml b/roles/workstation/tasks/software/terraform.yml new file mode 100644 index 0000000..33a682f --- /dev/null +++ b/roles/workstation/tasks/software/terraform.yml @@ -0,0 +1,9 @@ +- name: software | terraform | install binary + unarchive: + src: https://releases.hashicorp.com/terraform/{{ terraform_version }}/terraform_{{ terraform_version }}_linux_amd64.zip + dest: /usr/local/bin + remote_src: yes + mode: 0755 + owner: root + group: root + when: terraform is defined and terraform == true diff --git a/roles/workstation/tasks/software/thunderbird.yml b/roles/workstation/tasks/software/thunderbird.yml new file mode 100644 index 0000000..ae20f56 --- /dev/null +++ b/roles/workstation/tasks/software/thunderbird.yml @@ -0,0 +1,18 @@ +- name: software | thunderbird | install package + tags: packages,flatpak,thunderbird,workstation-packages + become_user: jay + flatpak: + name: org.mozilla.thunderbird + method: user + state: present + when: thunderbird is defined and thunderbird == true + +- name: software | thunderbird | enable autostart + tags: packages,flatpak,thunderbird,workstation-packages + file: + src: /home/jay/.local/share/flatpak/exports/share/applications/org.mozilla.Thunderbird.desktop + dest: /home/jay/.config/autostart/org.mozilla.Thunderbird.desktop + owner: jay + group: jay + state: link + when: thunderbird is defined and thunderbird == true diff --git a/roles/workstation/tasks/software/todoist.yml b/roles/workstation/tasks/software/todoist.yml new file mode 100644 index 0000000..56a6a67 --- /dev/null +++ b/roles/workstation/tasks/software/todoist.yml @@ -0,0 +1,23 @@ +# note: snap packages not automated in arch yet, snapd is not available in repo +- name: software | todoist | install package + tags: packages,snap,todoist,workstation-packages + snap: + name: todoist + state: present + when: + - ansible_distribution != "Archlinux" + - todoist is defined + - todoist == true + +- name: software | todoist | enable autostart + tags: packages,todoist,snap,workstation-packages + file: + src: /var/lib/snapd/desktop/applications/todoist_todoist.desktop + dest: /home/jay/.config/autostart/todoist_todoist.desktop + owner: jay + group: jay + state: link + when: + - ansible_distribution != "Archlinux" + - todoist is defined + - todoist == true diff --git a/roles/workstation/tasks/software/ulauncher.yml b/roles/workstation/tasks/software/ulauncher.yml new file mode 100644 index 0000000..46d5d80 --- /dev/null +++ b/roles/workstation/tasks/software/ulauncher.yml @@ -0,0 +1,32 @@ +- name: software | ulauncher | install ppa + tags: ulauncher + apt_repository: + repo: 'ppa:agornostal/ulauncher' + state: present + when: + - ansible_distribution in ["Pop!_OS", "Ubuntu"] + - ulauncher is defined + - ulauncher == true + +- name: software | ulauncher | install package + tags: ulauncher + apt: + name: ulauncher + state: latest + when: + - ansible_distribution in ["Pop!_OS", "Ubuntu"] + - ulauncher is defined + - ulauncher == true + +- name: software | ulauncher | enable autostart + tags: ulauncher + copy: + src: users/jay/ulauncher.desktop + dest: /home/jay/.config/autostart/ulauncher.desktop + owner: jay + group: jay + mode: 0600 + when: + - ansible_distribution in ["Pop!_OS", "Ubuntu"] + - ulauncher is defined + - ulauncher == true diff --git a/roles/workstation/tasks/software/vagrant.yml b/roles/workstation/tasks/software/vagrant.yml new file mode 100644 index 0000000..57efc9d --- /dev/null +++ b/roles/workstation/tasks/software/vagrant.yml @@ -0,0 +1,11 @@ +- name: software | vagrant | install binary + unarchive: + src: https://releases.hashicorp.com/vagrant/{{ vagrant_version }}/vagrant_{{ vagrant_version }}_linux_amd64.zip + dest: /usr/local/bin + remote_src: yes + mode: 0755 + owner: root + group: root + when: + - vagrant is defined + - vagrant == true diff --git a/roles/workstation/tasks/software/virtualbox.yml b/roles/workstation/tasks/software/virtualbox.yml new file mode 100644 index 0000000..8e93d2c --- /dev/null +++ b/roles/workstation/tasks/software/virtualbox.yml @@ -0,0 +1,32 @@ +# As of May 2, 2020; Virtualbox is available in backports, but is an old version. +# The following will add the official Virtualbox repo + +- name: software | virtualbox | install apt key (debian) + tags: virtualbox,repositories,virtualbox + apt_key: + url: https://www.virtualbox.org/download/oracle_vbox_2016.asc + state: present + when: + - ansible_distribution == "Debian" + - virtualbox is defined + - virtualbox == true + +- name: software | virtualbox | install repository (debian) + tags: virtualbox,repositories,virtualbox + apt_repository: + repo: deb https://download.virtualbox.org/virtualbox/debian buster contrib + state: present + filename: virtualbox + register: virtualbox_repo_debian + when: + - ansible_distribution == "Debian" + - virtualbox is defined + - virtualbox == true + +- name: software | virtualbox | install package + tags: virtualbox + package: + name: "{{ virtualbox_package }}" + when: + - virtualbox is defined + - virtualbox == true diff --git a/roles/workstation/tasks/software/vivaldi.yml b/roles/workstation/tasks/software/vivaldi.yml new file mode 100644 index 0000000..b8d66f9 --- /dev/null +++ b/roles/workstation/tasks/software/vivaldi.yml @@ -0,0 +1,36 @@ +- name: software | vivaldi | add repository key + tags: packages,vivaldi + apt_key: + url: https://repo.vivaldi.com/stable/linux_signing_key.pub + state: present + when: + - ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + - vivaldi is defined + - vivaldi == true + +- name: software | vivaldi | check if repository exists + stat: + path: /etc/apt/sources.list.d/vivaldi.list + register: vivaldi_repo_file + +- name: software | vivaldi | add repository + tags: packages,vivaldi + apt_repository: + repo: "deb https://repo.vivaldi.com/stable/deb/ stable main" + state: present + filename: vivaldi + when: + - ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + - vivaldi is defined + - vivaldi == true + - vivaldi_repo_file.stat.exists == False + +- name: software | vivaldi | install package + tags: packages,vivaldi + apt: + name: vivaldi-stable + state: latest + when: + - ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"] + - vivaldi is defined + - vivaldi == true diff --git a/roles/workstation/tasks/software/vlc.yml b/roles/workstation/tasks/software/vlc.yml new file mode 100644 index 0000000..e09c892 --- /dev/null +++ b/roles/workstation/tasks/software/vlc.yml @@ -0,0 +1,10 @@ +- name: software | vlc | install package + tags: packages,flatpak,vlc,workstation-packages + become_user: jay + flatpak: + name: org.videolan.VLC + method: user + state: present + when: + - vlc is defined + - vlc == true diff --git a/roles/workstation/tasks/software/xonotic.yml b/roles/workstation/tasks/software/xonotic.yml new file mode 100644 index 0000000..0b20190 --- /dev/null +++ b/roles/workstation/tasks/software/xonotic.yml @@ -0,0 +1,10 @@ +- name: software | xonotic | install package + tags: packages,flatpak,games,xonotic,workstation-packages + become_user: jay + flatpak: + name: org.xonotic.Xonotic + method: user + state: present + when: + - xonotic is defined + - xonotic == true