Skip to content

Commit 94c5347

Browse files
committed
add support for installing extensions
1 parent 90f69d2 commit 94c5347

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.ansible-lint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
skip_list:
3+
- no-changed-when
4+
- command-instead-of-shell
5+
- command-instead-of-module

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,23 @@ This role will not install the GNOME desktop itself - it should be pre-installed
5252
| -------- | ------- | ----------- |
5353
| `gnome_additional_settings` | `true` | Additional setting/value pairs (*as list*) |
5454

55+
### Installing extensions
56+
57+
In order to automate installing extensions, you'll need to find:
58+
59+
- the appropriate download URL for your GNOME Shell version
60+
- the extension UUID
61+
62+
The easiest way to find these information is to browse [https://extensions.gnome.org/](the GNOME extension catalog), manually select the appropriate version and copy the download URL. Extract the archive once and read the `uuid` value from `metadata.json`.
63+
64+
See the following YAML code for [a Podman extension](https://extensions.gnome.org/extension/1500/containers/) for GNOME 41:
65+
66+
```yaml
67+
gnome_extensions:
68+
- name: containers@royg
69+
url: https://extensions.gnome.org/extension-data/containersroyg.v19.shell-extension.zip
70+
```
71+
5572
## Dependencies
5673
5774
No dependencies.
@@ -83,6 +100,9 @@ Set variables if required, e.g.:
83100
value: ['']
84101
- setting: "/dummy/setting"
85102
state: absent
103+
gnome_extensions:
104+
- name: containers@royg
105+
url: https://extensions.gnome.org/extension-data/containersroyg.v19.shell-extension.zip
86106
```
87107
88108
## License

tasks/configure.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,34 @@
5858
state: "{{ item.state | default('present') }}"
5959
loop: "{{ gnome_additional_settings }}"
6060
when: gnome_additional_settings is defined
61+
62+
- name: Create extension directory
63+
file:
64+
path: ~/.local/share/gnome-shell/extensions
65+
owner: "{{ ansible_user_id }}"
66+
mode: '0750'
67+
state: directory
68+
when: gnome_extensions is defined
69+
70+
- name: Install extensions
71+
block:
72+
- name: Download archive
73+
get_url:
74+
url: "{{ item.url }}"
75+
dest: ~/.local/share/gnome-shell/extensions/
76+
loop: "{{ gnome_extensions }}"
77+
78+
- name: Create directory
79+
file:
80+
path: "~/.local/share/gnome-shell/extensions/{{ item.name }}"
81+
owner: "{{ ansible_user_id }}"
82+
mode: '0750'
83+
state: directory
84+
loop: "{{ gnome_extensions }}"
85+
86+
- name: Extract archive
87+
unarchive:
88+
src: "~/.local/share/gnome-shell/extensions/{{ item.url | basename }}"
89+
dest: "~/.local/share/gnome-shell/extensions/{{ item.name }}"
90+
loop: "{{ gnome_extensions }}"
91+
when: gnome_extensions is defined

0 commit comments

Comments
 (0)