PeterMosmans / ansible-role-customize-gnome

Ansible role that customizes the GNOME desktop. It installs fonts and GNOME extensions from packages or zip files, copies files like desktop backgrounds and GNOME shell tweaks to a host, and modifies user settings.
GNU General Public License v3.0
76 stars 20 forks source link

Gnome Extensions do not appear as installed #14

Closed neildeadman closed 2 years ago

neildeadman commented 2 years ago

Hello, I have been using Ansible for barely 2 days now. I've made some great progress, but one of the things I want to do is automatically install Gnome extensions, so I was pleased to find your custom role for this (and more!).

However, nothing I try seems to get it to work...

Here is my playbook:

- hosts: all
  become: true
  become_method: sudo
  roles:
    - role: petermosmans.customize-gnome
  vars:
    gnome_extensions:
      - url: https://extensions.gnome.org/download-extension/hidetopbar@mathieu.bidon.ca.shell-extension.zip?version_tag=6450
        name: hidetopbar@mathieu.bidon.ca
      - id: 15
        enable: yes
    gnome_user: nmd
    gtk_version: 3.0

Which I took from your example (with other bits stripped out).

I see the playbook complete, and it appears to do the relevant tasks, with the files appearing in ~/.local/share/gnome-shell/extensions/, but they do not list when I run gnome-settings list or if I browse to https://extensions.gnome.org/local/.

I'm sure this is me rather than an issue with your code, but I wasn't sure where else I could ask....

PeterMosmans commented 2 years ago

Hey @neildeadman , great to hear that you discovered the wonderful world of Ansible! In order to help you troubleshoot the issue, could you please let me know the version of Ansible, and, more importantly, which OS you're provisioning ?

neildeadman commented 2 years ago

@PeterMosmans I've been meaning to for a while so its good to finally get here!

So Ansible is running on my Mac Mini running Monterey, when I ran ansible --version at a terminal I go this:

% ansible --version
ansible [core 2.13.1]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/Volumes/Plex-NAS/GitHub/ansible/library']
  ansible python module location = /Users/nmd/Library/Python/3.8/lib/python/site-packages/ansible
  ansible collection location = /Users/nmd/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/nmd/Library/Python/3.8/bin/ansible
  python version = 3.8.9 (default, Apr 13 2022, 08:48:07) [Clang 13.1.6 (clang-1316.0.21.2.5)]
  jinja version = 3.1.2
  libyaml = True

I am trying to provision Debian 11 (my desktop) and Zorin 16 Pro (laptop). These are my initial systems, though I hope to extend this for use at work with Windows, Linux and possibly macOS too (obviously your role doesn't apply to Windows/macOS).

LorenzoBettini commented 2 years ago

In my experience, once you installed gnome extensions with Ansible like that, you have to logout and login in order to be able to see the extensions as installed. That happens also if you install gnome extensions manually, e.g., by downloading them and putting them in that directory.

neildeadman commented 2 years ago

I'm pretty sure that when I was trying it I did do a reboot, but I will try again and confirm.

LorenzoBettini commented 2 years ago

I'm not completely sure that might be related, but if you want to install the extensions in your user's home directory, I think you should not use become. At least, I don't do that

neildeadman commented 2 years ago

OK, I'll try that too

PeterMosmans commented 2 years ago

Hi @neildeadman - I just merged @LorenzoBettini 's feature (actually, fix ;) ) and published that as version 0.2.5. If you can pull the latest version and try that one out...

Thanks for your patience both :)

LorenzoBettini commented 2 years ago

@PeterMosmans sorry to bother you, but https://galaxy.ansible.com/PeterMosmans/customize-gnome is not aware of the new release ;)

PeterMosmans commented 2 years ago

On the contrary @LorenzoBettini - thanks for letting me know. Apparently the webhook doesn't work anymore, so I had to do a manual import. Your fix is live @LorenzoBettini in 0.2.5, thanks once again!

neildeadman commented 2 years ago

@PeterMosmans I've done some testing, and there are some extensions that I chose randomly that didn't seem to install, but I configured the ones I wanted and they do seem to work now. Looks to be something funny my end. Thanks for the support, but I think other than more testing to refine things my end, I am satisfied this is working and can be closed.

PeterMosmans commented 2 years ago

Thanks for getting back to me @neildeadman - should you have any other issues, feel free to open another one.