mirror of
https://github.com/fscotto/infra.git
synced 2026-05-31 07:49:57 +00:00
Add GNOME extension management for workstation
This commit is contained in:
@@ -65,3 +65,21 @@ workstation_templates:
|
|||||||
- src: workstation/.gitconfig.j2
|
- src: workstation/.gitconfig.j2
|
||||||
dest: .gitconfig
|
dest: .gitconfig
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
|
workstation_gnome_extensions:
|
||||||
|
- id: 9308
|
||||||
|
uuid: bluetooth-battery-monitor@v8v88v8v88.com
|
||||||
|
version_tag: 68559
|
||||||
|
enabled: true
|
||||||
|
- id: 1401
|
||||||
|
uuid: bluetooth-quick-connect@bjarosze.gmail.com
|
||||||
|
version_tag: 65323
|
||||||
|
enabled: true
|
||||||
|
- id: 6099
|
||||||
|
uuid: paperwm@paperwm.github.com
|
||||||
|
version_tag: 68525
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
workstation_disabled_gnome_extensions:
|
||||||
|
- tiling-assistant@ubuntu.com
|
||||||
|
- ubuntu-dock@ubuntu.com
|
||||||
|
|||||||
@@ -34,3 +34,67 @@
|
|||||||
loop: "{{ workstation_templates | default([]) }}"
|
loop: "{{ workstation_templates | default([]) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.dest }}"
|
label: "{{ item.dest }}"
|
||||||
|
|
||||||
|
- name: Ensure GNOME extension directories exist
|
||||||
|
tags: [packages, gnome]
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ username }}"
|
||||||
|
group: "{{ user_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- "{{ user_home }}/.cache/gnome-shell/extensions"
|
||||||
|
- "{{ user_home }}/.local/share/gnome-shell/extensions"
|
||||||
|
|
||||||
|
- name: Install workstation GNOME extensions from website
|
||||||
|
tags: [packages, gnome]
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ user_home }}/.local/share/gnome-shell/extensions/{{ item.uuid }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ username }}"
|
||||||
|
group: "{{ user_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop: "{{ workstation_gnome_extensions | default([]) }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.uuid }}"
|
||||||
|
|
||||||
|
- name: Extract workstation GNOME extensions from website
|
||||||
|
tags: [packages, gnome]
|
||||||
|
ansible.builtin.unarchive:
|
||||||
|
src: >-
|
||||||
|
https://extensions.gnome.org/download-extension/{{ item.uuid }}.shell-extension.zip?version_tag={{ item.version_tag }}
|
||||||
|
dest: "{{ user_home }}/.local/share/gnome-shell/extensions/{{ item.uuid }}"
|
||||||
|
remote_src: true
|
||||||
|
owner: "{{ username }}"
|
||||||
|
group: "{{ user_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop: "{{ workstation_gnome_extensions | default([]) }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.uuid }}"
|
||||||
|
|
||||||
|
- name: Disable workstation GNOME extensions
|
||||||
|
tags: [gnome]
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "gnome-extensions disable {{ item }}"
|
||||||
|
become_user: "{{ username }}"
|
||||||
|
environment:
|
||||||
|
HOME: "{{ user_home }}"
|
||||||
|
loop: "{{ workstation_disabled_gnome_extensions | default([]) }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item }}"
|
||||||
|
changed_when: false
|
||||||
|
when: (workstation_disabled_gnome_extensions | default([])) | length > 0
|
||||||
|
|
||||||
|
- name: Enable workstation GNOME extensions
|
||||||
|
tags: [gnome]
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "gnome-extensions enable {{ item.uuid }}"
|
||||||
|
become_user: "{{ username }}"
|
||||||
|
environment:
|
||||||
|
HOME: "{{ user_home }}"
|
||||||
|
loop: "{{ workstation_gnome_extensions | default([]) }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.uuid }}"
|
||||||
|
changed_when: false
|
||||||
|
when: item.enabled | default(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user