refactor
This commit is contained in:
51
ansible/tasks/workstations/1password-browsers.yml
Normal file
51
ansible/tasks/workstations/1password-browsers.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: Process 1Password custom allowed browsers
|
||||
block:
|
||||
- name: Check if 1Password is installed
|
||||
ansible.builtin.command: 1password --version
|
||||
register: onepassword_check
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Check if 1Password is running anywhere
|
||||
ansible.builtin.command: pgrep 1password
|
||||
register: onepassword_running
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Ensure 1Password custom allowed browsers directory exists
|
||||
ansible.builtin.file:
|
||||
path: /etc/1password
|
||||
state: directory
|
||||
mode: "0755"
|
||||
become: true
|
||||
|
||||
- name: Add Browsers to 1Password custom allowed browsers
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
ZenBrowser
|
||||
zen-browser
|
||||
app.zen_browser.zen
|
||||
zen
|
||||
Firefox
|
||||
firefox
|
||||
opera
|
||||
zen-x86_64
|
||||
dest: /etc/1password/custom_allowed_browsers
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
become: true
|
||||
register: custom_browsers_file
|
||||
|
||||
- name: Kill any running 1Password instances if configuration changed
|
||||
ansible.builtin.command: pkill 1password
|
||||
when: custom_browsers_file.changed and onepassword_running.stdout != ""
|
||||
changed_when: custom_browsers_file.changed and onepassword_running.stdout != ""
|
||||
|
||||
- name: If 1Password was killed, restart it...
|
||||
ansible.builtin.command: screen -dmS 1password 1password
|
||||
when: custom_browsers_file.changed and onepassword_running.stdout != ""
|
||||
changed_when: custom_browsers_file.changed and onepassword_running.stdout != ""
|
||||
tags:
|
||||
- custom_allowed_browsers
|
||||
6
ansible/tasks/workstations/autostart.yml
Normal file
6
ansible/tasks/workstations/autostart.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
# Mark all files under the real autostart source as executable
|
||||
- name: Mark all files under dotfiles autostart as executable
|
||||
ansible.builtin.file:
|
||||
path: "{{ lookup('env', 'DOTFILES_PATH') }}/config/autostart"
|
||||
mode: "u+x,g+x,o+x"
|
||||
recurse: true
|
||||
41
ansible/tasks/workstations/cliphist.yml
Normal file
41
ansible/tasks/workstations/cliphist.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
- name: Ensure wl-clipboard and cliphist are installed
|
||||
become: true
|
||||
package:
|
||||
name:
|
||||
- wl-clipboard
|
||||
- cliphist
|
||||
- wofi
|
||||
state: present
|
||||
|
||||
- name: Create systemd user service for cliphist
|
||||
become: false
|
||||
copy:
|
||||
dest: "{{ ansible_env.HOME }}/.config/systemd/user/cliphist-store.service"
|
||||
mode: "0644"
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Store clipboard history with cliphist
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/sh -c 'wl-paste --watch cliphist store'
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
- name: Reload systemd user daemon
|
||||
become: false
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
scope: user
|
||||
|
||||
# TO ENABLE READING, ADD A KEYBOARD SHORTCUT SOMEWHERE IN YOUR WM CONFIGURATION
|
||||
# cliphist list | wofi -S dmenu | cliphist decode | wl-copy
|
||||
- name: Enable and start cliphist-store service
|
||||
become: false
|
||||
systemd:
|
||||
name: cliphist-store.service
|
||||
enabled: yes
|
||||
state: started
|
||||
scope: user
|
||||
61
ansible/tasks/workstations/firefox-apt.yml
Normal file
61
ansible/tasks/workstations/firefox-apt.yml
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
- name: Install Firefox via APT (Not Snap)
|
||||
block:
|
||||
- name: Remove Firefox Snap if installed
|
||||
community.general.snap:
|
||||
name: firefox
|
||||
state: absent
|
||||
become: true
|
||||
|
||||
- name: Create APT keyring directory if it doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: /etc/apt/keyrings
|
||||
state: directory
|
||||
mode: "0755"
|
||||
become: true
|
||||
|
||||
- name: Import Mozilla APT repo signing key
|
||||
ansible.builtin.get_url:
|
||||
url: https://packages.mozilla.org/apt/repo-signing-key.gpg
|
||||
dest: /etc/apt/keyrings/packages.mozilla.org.asc
|
||||
mode: "0644"
|
||||
become: true
|
||||
|
||||
- name: Add Mozilla APT repository
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/apt/sources.list.d/mozilla.list
|
||||
line: "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main"
|
||||
create: true
|
||||
mode: "0644"
|
||||
become: true
|
||||
|
||||
- name: Set Firefox package priority
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/apt/preferences.d/mozilla
|
||||
content: |
|
||||
Package: *
|
||||
Pin: origin packages.mozilla.org
|
||||
Pin-Priority: 1000
|
||||
|
||||
Package: firefox*
|
||||
Pin: release o=Ubuntu
|
||||
Pin-Priority: -1
|
||||
mode: "0644"
|
||||
become: true
|
||||
|
||||
- name: Update apt cache
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
become: true
|
||||
|
||||
- name: Remove Ubuntu's Firefox transition package
|
||||
ansible.builtin.apt:
|
||||
name: firefox
|
||||
state: absent
|
||||
become: true
|
||||
|
||||
- name: Install Firefox from Mozilla's repository
|
||||
ansible.builtin.apt:
|
||||
name: firefox
|
||||
state: present
|
||||
become: true
|
||||
116
ansible/tasks/workstations/flatpaks.yml
Normal file
116
ansible/tasks/workstations/flatpaks.yml
Normal file
@@ -0,0 +1,116 @@
|
||||
---
|
||||
- name: Check if Flatpak is installed
|
||||
ansible.builtin.command: which flatpak
|
||||
register: flatpak_check
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Install Flatpak
|
||||
ansible.builtin.package:
|
||||
name: flatpak
|
||||
state: present
|
||||
become: true
|
||||
when: flatpak_check.rc != 0
|
||||
|
||||
- name: Add Flathub remote repository
|
||||
community.general.flatpak_remote:
|
||||
name: flathub
|
||||
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||
state: present
|
||||
|
||||
- name: Get list of system installed Flatpaks
|
||||
ansible.builtin.command: flatpak list --system --app --columns=application
|
||||
register: installed_system_flatpaks
|
||||
changed_when: false
|
||||
|
||||
- name: Get list of system remotes
|
||||
ansible.builtin.command: flatpak remote-list --system --columns=name
|
||||
register: system_remotes
|
||||
changed_when: false
|
||||
|
||||
- name: Define system desired Flatpaks
|
||||
ansible.builtin.set_fact:
|
||||
desired_system_flatpaks:
|
||||
# GNOME Software
|
||||
- "{{ 'org.gnome.Extensions' if (ansible_facts.env.XDG_CURRENT_DESKTOP is defined and 'GNOME' in ansible_facts.env.XDG_CURRENT_DESKTOP) else omit }}"
|
||||
- "{{ 'org.gnome.Weather' if (ansible_facts.env.XDG_CURRENT_DESKTOP is defined and 'GNOME' in ansible_facts.env.XDG_CURRENT_DESKTOP) else omit }}"
|
||||
- "{{ 'org.gnome.Sudoku' if (ansible_facts.env.XDG_CURRENT_DESKTOP is defined and 'GNOME' in ansible_facts.env.XDG_CURRENT_DESKTOP) else omit }}"
|
||||
|
||||
# Games
|
||||
- io.github.openhv.OpenHV
|
||||
- info.beyondallreason.bar
|
||||
- org.godotengine.Godot
|
||||
- dev.bragefuglseth.Keypunch
|
||||
- org.prismlauncher.PrismLauncher
|
||||
|
||||
# Multimedia
|
||||
- com.plexamp.Plexamp
|
||||
- tv.plex.PlexDesktop
|
||||
|
||||
# Messaging
|
||||
- com.rtosta.zapzap
|
||||
- org.telegram.desktop
|
||||
- org.signal.Signal
|
||||
- com.spotify.Client
|
||||
|
||||
# Nextcloud Compatible Utilities
|
||||
- io.github.mrvladus.List
|
||||
- org.gnome.World.Iotas
|
||||
|
||||
# 3D Printing
|
||||
- com.bambulab.BambuStudio
|
||||
- io.mango3d.LycheeSlicer
|
||||
|
||||
# Utilities
|
||||
- com.ranfdev.DistroShelf
|
||||
- io.missioncenter.MissionCenter
|
||||
- io.gitlab.elescoute.spacelaunch
|
||||
- org.fkoehler.KTailctl
|
||||
- com.usebottles.bottles
|
||||
- com.github.tchx84.Flatseal
|
||||
- com.github.wwmm.easyeffects
|
||||
- io.gitlab.adhami3310.Impression
|
||||
- io.ente.auth
|
||||
- io.github.fastrizwaan.WineZGUI
|
||||
- net.davidotek.pupgui2
|
||||
- com.mastermindzh.tidal-hifi
|
||||
- io.github.flattool.Warehouse
|
||||
- io.github.johannesboehler2.BmiCalculator
|
||||
- io.github.nokse22.Exhibit
|
||||
- net.nokyan.Resources
|
||||
- io.github.flattool.Ignition
|
||||
- io.github.bytezz.IPLookup
|
||||
- org.gaphor.Gaphor
|
||||
|
||||
- name: Define system desired Flatpak remotes
|
||||
ansible.builtin.set_fact:
|
||||
desired_system_flatpak_remotes:
|
||||
- flathub
|
||||
|
||||
- name: Add desired system Flatpak remotes
|
||||
community.general.flatpak_remote:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
method: system
|
||||
loop: "{{ desired_system_flatpak_remotes }}"
|
||||
|
||||
- name: Remove undesired system Flatpak remotes
|
||||
community.general.flatpak_remote:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
method: system
|
||||
loop: "{{ system_remotes.stdout_lines | difference(desired_system_flatpak_remotes) }}"
|
||||
|
||||
- name: Install/Upgrade Flatpak packages
|
||||
community.general.flatpak:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
method: system
|
||||
loop: "{{ desired_system_flatpaks | reject('equalto', omit) | list }}"
|
||||
|
||||
- name: Remove undesired system Flatpaks
|
||||
community.general.flatpak:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
method: system
|
||||
loop: "{{ installed_system_flatpaks.stdout_lines | difference(desired_system_flatpaks | reject('equalto', omit) | list) }}"
|
||||
18
ansible/tasks/workstations/gnome-extensions.yml
Normal file
18
ansible/tasks/workstations/gnome-extensions.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Install Pano - Clipboard Manager dependencies
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- gir1.2-gda-5.0
|
||||
- gir1.2-gsound-1.0
|
||||
state: present
|
||||
update_cache: true
|
||||
become: true
|
||||
|
||||
- name: Install Pano - Clipboard Manager
|
||||
ansible.builtin.import_tasks: tasks/workstations/gnome-extensions/pano.yml
|
||||
|
||||
- name: Install Tiling Shell - Window Manager
|
||||
ansible.builtin.import_tasks: tasks/workstations/gnome-extensions/tilingshell.yml
|
||||
|
||||
- name: Install Quick Settings Tweaks
|
||||
ansible.builtin.import_tasks: tasks/workstations/gnome-extensions/quick-settings.yml
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
- name: Manage GNOME extension
|
||||
vars:
|
||||
requested_git_tag: "{{ git_tag }}"
|
||||
extension_name: "{{ ext_name }}"
|
||||
extension_url: "{{ ext_url }}"
|
||||
extension_path: "{{ ansible_user_dir }}/.local/share/gnome-shell/extensions/{{ ext_id }}"
|
||||
version_file: "{{ extension_path }}/version.txt"
|
||||
block:
|
||||
- name: Check if extension is installed
|
||||
ansible.builtin.stat:
|
||||
path: "{{ extension_path }}"
|
||||
register: ext_check
|
||||
|
||||
- name: Read last installed version
|
||||
ansible.builtin.slurp:
|
||||
src: "{{ version_file }}"
|
||||
register: installed_version
|
||||
ignore_errors: true
|
||||
when: ext_check.stat.exists
|
||||
|
||||
- name: Determine if update is needed
|
||||
ansible.builtin.set_fact:
|
||||
update_needed: >-
|
||||
{{ installed_version.content is not defined or
|
||||
(installed_version.content | b64decode | trim != requested_git_tag) }}
|
||||
|
||||
- name: Delete old extension if updating
|
||||
ansible.builtin.file:
|
||||
path: "{{ extension_path }}"
|
||||
state: absent
|
||||
when: update_needed
|
||||
|
||||
- name: Create directory for extension
|
||||
ansible.builtin.file:
|
||||
path: "{{ extension_path }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
when: not ext_check.stat.exists or update_needed
|
||||
|
||||
- name: Download extension
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ extension_url | replace('%TAG%', requested_git_tag) }}"
|
||||
dest: "{{ extension_path }}/release.zip"
|
||||
mode: "0644"
|
||||
when: update_needed or not ext_check.stat.exists
|
||||
|
||||
- name: Extract extension
|
||||
ansible.builtin.unarchive:
|
||||
src: "{{ extension_path }}/release.zip"
|
||||
dest: "{{ extension_path }}"
|
||||
when: update_needed or not ext_check.stat.exists
|
||||
|
||||
- name: Store installed version of the extension
|
||||
ansible.builtin.copy:
|
||||
content: "{{ requested_git_tag }}"
|
||||
dest: "{{ version_file }}"
|
||||
mode: "0644"
|
||||
when: update_needed or not ext_check.stat.exists
|
||||
|
||||
- name: Cleanup post installation
|
||||
ansible.builtin.file:
|
||||
path: "{{ extension_path }}/release.zip"
|
||||
state: absent
|
||||
when: not ext_check.stat.exists or update_needed
|
||||
|
||||
- name: Notify user of required GNOME Shell reload
|
||||
ansible.builtin.debug:
|
||||
msg: >
|
||||
Please reload GNOME Shell by pressing Alt + F2, typing 'r' and pressing Enter.
|
||||
Then enable the {{ extension_name }} in GNOME Tweaks.
|
||||
Or on Wayland, log out and back in.
|
||||
when: not ext_check.stat.exists or update_needed
|
||||
8
ansible/tasks/workstations/gnome-extensions/pano.yml
Normal file
8
ansible/tasks/workstations/gnome-extensions/pano.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Manage Pano Clipboard Manager
|
||||
ansible.builtin.include_tasks: tasks/workstations/gnome-extensions/manage_gnome_extension.yml
|
||||
vars:
|
||||
git_tag: "v23-alpha5"
|
||||
ext_name: "Pano - Clipboard Manager"
|
||||
ext_url: "https://github.com/oae/gnome-shell-pano/releases/download/%TAG%/pano@elhan.io.zip"
|
||||
ext_id: "pano@elhan.io"
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Manage Quick Settings Tweaks
|
||||
ansible.builtin.include_tasks: tasks/workstations/gnome-extensions/manage_gnome_extension.yml
|
||||
vars:
|
||||
git_tag: "2.1-stable"
|
||||
ext_name: "Quick Settings Tweaks"
|
||||
ext_url: "https://github.com/qwreey/quick-settings-tweaks/releases/download/2.1-stable/2.1-release.zip"
|
||||
ext_id: "quick-settings-tweaks@qwreey"
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Manage Tiling Shell - Window Manager
|
||||
ansible.builtin.include_tasks: tasks/workstations/gnome-extensions/manage_gnome_extension.yml
|
||||
vars:
|
||||
git_tag: "16.3"
|
||||
ext_name: "Tiling Shell - Window Manager"
|
||||
ext_url: "https://github.com/domferr/tilingshell/releases/download/%TAG%/tilingshell@ferrarodomenico.com.zip"
|
||||
ext_id: "tilingshell@ferrarodomenico.com"
|
||||
21
ansible/tasks/workstations/purge-libreoffice.yml
Normal file
21
ansible/tasks/workstations/purge-libreoffice.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: Purge LibreOffice and related packages
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- libreoffice*
|
||||
- libreoffice-common
|
||||
- libreoffice-core
|
||||
- libreoffice-writer
|
||||
- libreoffice-calc
|
||||
- libreoffice-impress
|
||||
- libreoffice-draw
|
||||
- libreoffice-base
|
||||
- libreoffice-math
|
||||
- libreoffice-gnome
|
||||
- libreoffice-gtk3
|
||||
state: absent
|
||||
purge: true
|
||||
autoremove: true
|
||||
update_cache: true
|
||||
when: ansible_pkg_mgr == 'apt'
|
||||
75
ansible/tasks/workstations/snaps.yml
Normal file
75
ansible/tasks/workstations/snaps.yml
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
- name: Ensure snapd is installed
|
||||
ansible.builtin.package:
|
||||
name: snapd
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Ensure snapd service is enabled and started
|
||||
ansible.builtin.systemd:
|
||||
name: snapd
|
||||
state: started
|
||||
enabled: true
|
||||
become: true
|
||||
|
||||
- name: Get list of installed Snaps
|
||||
ansible.builtin.command: snap list
|
||||
register: installed_snaps
|
||||
changed_when: false
|
||||
|
||||
- name: Define protected system snaps
|
||||
ansible.builtin.set_fact:
|
||||
system_snaps:
|
||||
- snapd
|
||||
- core
|
||||
- core18
|
||||
- core20
|
||||
- core22
|
||||
- core24
|
||||
- bare
|
||||
- chromium
|
||||
- gtk-common-themes
|
||||
- gnome-3-28-1804
|
||||
- gnome-3-34-1804
|
||||
- gnome-3-38-2004
|
||||
- gnome-42-2204
|
||||
- desktop-security-center
|
||||
- firmware-updater
|
||||
- prompting-client
|
||||
- snap-store
|
||||
- snapd-desktop-integration
|
||||
- gaming-graphics-core22
|
||||
|
||||
- name: Define desired Snaps
|
||||
ansible.builtin.set_fact:
|
||||
desired_snaps:
|
||||
- name: beekeeper-studio
|
||||
classic: false
|
||||
|
||||
- name: Install desired Snap packages
|
||||
ansible.builtin.command: "snap install {{ item.name }} {{ '--classic' if item.classic else '' }}"
|
||||
loop: "{{ desired_snaps }}"
|
||||
become: true
|
||||
register: snap_install
|
||||
changed_when: "'already installed' not in snap_install.stderr"
|
||||
failed_when:
|
||||
- snap_install.rc != 0
|
||||
- "'already installed' not in snap_install.stderr"
|
||||
|
||||
- name: Remove undesired Snap packages
|
||||
ansible.builtin.command: "snap remove {{ item }}"
|
||||
become: true
|
||||
loop: >-
|
||||
{{
|
||||
installed_snaps.stdout_lines[1:]
|
||||
| map('split', ' ')
|
||||
| map('first')
|
||||
| difference(desired_snaps | map(attribute='name'))
|
||||
| difference(system_snaps)
|
||||
}}
|
||||
register: snap_remove
|
||||
changed_when: snap_remove.rc == 0
|
||||
failed_when:
|
||||
- snap_remove.rc != 0
|
||||
- "'not installed' not in snap_remove.stderr"
|
||||
- "'cannot remove' not in snap_remove.stderr"
|
||||
38
ansible/tasks/workstations/symlinks.yml
Normal file
38
ansible/tasks/workstations/symlinks.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
- name: Set user home directory
|
||||
ansible.builtin.set_fact:
|
||||
user_home: "{{ ansible_env.HOME if ansible_user_id == 'root' else lookup('env', 'HOME') }}"
|
||||
|
||||
- name: Define workstation symlinks
|
||||
ansible.builtin.set_fact:
|
||||
workstation_symlinks:
|
||||
- {
|
||||
src: "$DOTFILES_PATH/vscode/settings.json",
|
||||
dest: "~/.config/Code/User/settings.json",
|
||||
}
|
||||
- {
|
||||
src: "$DOTFILES_PATH/zed/settings.json",
|
||||
dest: "~/.config/zed/settings.json",
|
||||
}
|
||||
- { src: "$DOTFILES_PATH/config/autostart", dest: "~/.config/autostart" }
|
||||
|
||||
- name: Ensure parent directories for workstation symlinks exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.dest | replace('~', user_home) | dirname }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
loop: "{{ workstation_symlinks }}"
|
||||
|
||||
- name: Remove existing autostart directory if it exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ user_home }}/.config/autostart"
|
||||
state: absent
|
||||
|
||||
- name: Create workstation symlinks
|
||||
ansible.builtin.file:
|
||||
src: "{{ item.src | replace('~', user_home) | replace('$DOTFILES_PATH', lookup('env', 'DOTFILES_PATH')) }}"
|
||||
dest: "{{ item.dest | replace('~', user_home) }}"
|
||||
state: link
|
||||
force: true
|
||||
follow: false
|
||||
loop: "{{ workstation_symlinks }}"
|
||||
74
ansible/tasks/workstations/workstation.yml
Normal file
74
ansible/tasks/workstations/workstation.yml
Normal file
@@ -0,0 +1,74 @@
|
||||
---
|
||||
- name: Workstation Setup
|
||||
block:
|
||||
- name: Include workstation symlinks tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/symlinks.yml
|
||||
|
||||
- name: Include workstation cliphist tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/cliphist.yml
|
||||
when: "'microsoft-standard-WSL2' not in ansible_kernel"
|
||||
|
||||
- name: Include GNOME Extensions tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/gnome-extensions.yml
|
||||
when: ansible_facts.env.XDG_CURRENT_DESKTOP is defined and 'GNOME' in ansible_facts.env.XDG_CURRENT_DESKTOP and 'microsoft-standard-WSL2' not in ansible_kernel
|
||||
|
||||
- name: Include Firefox APT installation tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/firefox-apt.yml
|
||||
when: ansible_pkg_mgr == 'apt' and ansible_facts.packages.snapd is defined and 'microsoft-standard-WSL2' not in ansible_kernel
|
||||
|
||||
- name: Include flatpaks tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/flatpaks.yml
|
||||
when: "'microsoft-standard-WSL2' not in ansible_kernel"
|
||||
tags: flatpaks
|
||||
|
||||
- name: Include snaps tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/snaps.yml
|
||||
when: ansible_facts.packages.snapd is defined and 'microsoft-standard-WSL2' not in ansible_kernel
|
||||
|
||||
- name: Include Zen browser tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/zen-browser.yml
|
||||
vars:
|
||||
browser_name: "zen"
|
||||
browser_executable: "zen"
|
||||
when: "'microsoft-standard-WSL2' not in ansible_kernel"
|
||||
|
||||
- name: Include 1Password Browsers tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/1password-browsers.yml
|
||||
when: "'microsoft-standard-WSL2' not in ansible_kernel"
|
||||
|
||||
- name: Include purge LibreOffice tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/purge-libreoffice.yml
|
||||
|
||||
- name: Include autostart tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/autostart.yml
|
||||
when: "'microsoft-standard-WSL2' not in ansible_kernel"
|
||||
|
||||
- name: Ensure workstation common packages are installed
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
# Statistics HUD for gaming
|
||||
- mangohud
|
||||
# Used for VSCode Extensions
|
||||
- nodejs
|
||||
# DistroBox
|
||||
- distrobox
|
||||
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Ensure Ubuntu/Debian packages are installed
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- clang
|
||||
- cmake
|
||||
- git
|
||||
- ninja-build
|
||||
- pkg-config
|
||||
- libgtk-3-dev
|
||||
- liblzma-dev
|
||||
- libstdc++-12-dev
|
||||
- dolphin-nextcloud
|
||||
- nextcloud-desktop
|
||||
state: present
|
||||
when: ansible_pkg_mgr == 'apt'
|
||||
become: true
|
||||
89
ansible/tasks/workstations/zen-browser.yml
Normal file
89
ansible/tasks/workstations/zen-browser.yml
Normal file
@@ -0,0 +1,89 @@
|
||||
---
|
||||
- name: Install Zen browser
|
||||
block:
|
||||
- name: Set Zen browser version
|
||||
ansible.builtin.set_fact:
|
||||
zen_browser_version: "1.15b"
|
||||
|
||||
- name: Create directory for browser
|
||||
ansible.builtin.file:
|
||||
path: "/opt/{{ browser_name }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
become: true
|
||||
|
||||
- name: Download Zen browser tarball
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/zen-browser/desktop/releases/download/{{ zen_browser_version }}/zen.linux-x86_64.tar.xz"
|
||||
dest: "/tmp/{{ browser_name }}.tar.xz"
|
||||
mode: "0644"
|
||||
become: true
|
||||
|
||||
- name: Extract browser tarball
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/{{ browser_name }}.tar.xz"
|
||||
dest: "/opt/{{ browser_name }}"
|
||||
remote_src: true
|
||||
extra_opts: [--strip-components=1]
|
||||
become: true
|
||||
|
||||
- name: Create symlink to browser executable
|
||||
ansible.builtin.file:
|
||||
src: "/opt/{{ browser_name }}/{{ browser_executable }}"
|
||||
dest: "/usr/local/bin/{{ browser_name }}"
|
||||
state: link
|
||||
become: true
|
||||
|
||||
- name: Create desktop file
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=Zen Browser
|
||||
Exec=/usr/local/bin/{{ browser_name }} %u
|
||||
Icon=/opt/zen/browser/chrome/icons/default/default128.png
|
||||
Type=Application
|
||||
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
|
||||
StartupWMClass=zen
|
||||
Categories=Network;WebBrowser;
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
X-MultipleArgs=false
|
||||
Keywords=Internet;WWW;Browser;Web;Explorer;
|
||||
Actions=new-window;new-private-window;profilemanager;
|
||||
|
||||
[Desktop Action new-window]
|
||||
Name=Open a New Window
|
||||
Exec=/usr/local/bin/{{ browser_name }} %u
|
||||
|
||||
[Desktop Action new-private-window]
|
||||
Name=Open a New Private Window
|
||||
Exec=/usr/local/bin/{{ browser_name }} --private-window %u
|
||||
|
||||
[Desktop Action profilemanager]
|
||||
Name=Open the Profile Manager
|
||||
Exec=/usr/local/bin/{{ browser_name }} --ProfileManager %u
|
||||
dest: "/usr/share/applications/zen.desktop"
|
||||
mode: "0644"
|
||||
become: true
|
||||
|
||||
- name: Update desktop database
|
||||
ansible.builtin.command:
|
||||
cmd: update-desktop-database /usr/share/applications
|
||||
creates: /usr/share/applications/mimeinfo.cache
|
||||
become: true
|
||||
|
||||
- name: Make desktop file executable
|
||||
ansible.builtin.file:
|
||||
dest: "/usr/share/applications/zen.desktop"
|
||||
mode: "0755"
|
||||
become: true
|
||||
|
||||
- name: Clean up downloaded tarball
|
||||
ansible.builtin.file:
|
||||
path: "/tmp/{{ browser_name }}.tar.xz"
|
||||
state: absent
|
||||
become: true
|
||||
tags:
|
||||
- zen-browser
|
||||
- zen
|
||||
Reference in New Issue
Block a user