ansible-community / ansible-nomad

:watch: Ansible role for Nomad
https://galaxy.ansible.com/brianshumate/nomad
BSD 2-Clause "Simplified" License
297 stars 165 forks source link

Fix libcgroup dependency in Ubuntu 22.10 and newer #163

Closed deltabweb closed 10 months ago

deltabweb commented 1 year ago

I tried to run the role on Ubuntu 23.04 and got an error about the package libcgroup1 not existing. After checking https://launchpad.net/ubuntu/+source/libcgroup, it looks like the package was renamed to libcgroup2 in Ubuntu 22.10 Both libcgroup1 and libcgroup2 seem to actually use the version 2 of libcgroup I installed nomad successfully on Ubuntu 23.04 with this fix

LordAro commented 1 year ago

This is also an issue for debian 12, would be good if the same fix could be applied for that as per cgroup-bin below

beechesII commented 1 year ago

@deltabweb maybe you can change line 7 to:

  - "{% if ( ansible_distribution  == 'Ubuntu' and ansible_distribution_version is version('22.10', '<')) or \
      ( ansible_distribution  == 'Debian' and ansible_distribution_version is version('12', '<') ) \
    %}\

So the fix also works for Debian 12.

deltabweb commented 1 year ago

@beechesII Sounds good, I have just updated the PR

LordAro commented 1 year ago

I actually had a different solution to this on my end - just remove libcgroupN from the deps list entirely

It's not used directly as far I can tell and it's pulled in by cgroups-bin / cgroups-tools anyway - just let the package manager worry about it

beechesII commented 11 months ago

I actually had a different solution to this on my end - just remove libcgroupN from the deps list entirely

It's not used directly as far I can tell and it's pulled in by cgroups-bin / cgroups-tools anyway - just let the package manager worry about it

I'm not sure if every package manger will install libcgroup1 or libcgroup2 as a dependency. I only found information about this for debian. Therefore I think we shouldn't delete the installation for these packages.

beechesII commented 11 months ago

@bbaassssiiee @lanefu please have a look.

beechesII commented 10 months ago

@deltabweb can you please update your actual master. I added molecule tests for the role. Your PR should fix the tests for debian 12 and ubuntu 23.04.

deltabweb commented 10 months ago

@beechesII I've just updated master with a merge commit, let me know if I should rebase instead