Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ubuntu 22.04 molecule test to actually run on 22.04 #594

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

slonopotamus
Copy link
Contributor

SUMMARY

molecule/ubuntu-22.04/molecule.yml used 20.04 instead of 22.04, this definitely was not intended.

ISSUE TYPE
  • Bugfix Pull Request

rndmh3ro
rndmh3ro previously approved these changes Apr 2, 2024
Copy link
Contributor

@nre-ableton nre-ableton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! 👍

Unfortunately, CI is failing because jammy doesn't have a python package (it was renamed to python3). We'll need to adapt Dockerfile.j2 in this change.

@slonopotamus
Copy link
Contributor Author

I believe that focal also has python3. Pushed an update to PR.

@slonopotamus
Copy link
Contributor Author

@nre-ableton Could you please trigger CI again? The way how workflows are set up prevent them from running in my forked branch.

@slonopotamus
Copy link
Contributor Author

slonopotamus commented Apr 2, 2024

If I read build log correctly, it fails with /bin/sh: 1: cd: can't cd to ansible-community/ansible-consul. Not sure what to do with it.

@rndmh3ro
Copy link
Collaborator

rndmh3ro commented Apr 2, 2024

That's just a warning. The build fails here:

  
  TASK [Build an Ansible compatible image (new)] *********************************
  failed: [localhost] (item=molecule_local/dokken/ubuntu-22.04) => {"ansible_loop_var": "item", "attempts": 3, "changed": false, "item": {"ansible_index_var": "i", "ansible_loop_var": "item", "changed": true, "checksum": "64912d63af91d7ac8119026bde9a9f4c5eb71842", "dest": "/github/home/.cache/molecule/workspace/ubuntu-22.04/Dockerfile_dokken_ubuntu_22_04", "diff": [], "failed": false, "gid": 0, "group": "root", "i": 0, "invocation": {"module_args": {"_original_basename": "Dockerfile.j2", "attributes": null, "backup": false, "checksum": "64912d63af91d7ac8119026bde9a9f4c5eb71842", "content": null, "dest": "/github/home/.cache/molecule/workspace/ubuntu-22.04/Dockerfile_dokken_ubuntu_22_04", "directory_mode": null, "follow": false, "force": true, "group": null, "local_follow": null, "mode": "0600", "owner": null, "remote_src": null, "selevel": null, "serole": null, "setype": null, "seuser": null, "src": "/root/.ansible/tmp/ansible-tmp-1712065789.1587434-44-224359164378947/source", "unsafe_writes": false, "validate": null}}, "item": {"capabilities": ["SYS_ADMIN"], "cgroupns_mode": "host", "command": "/lib/systemd/systemd", "dockerfile": "../_shared/Dockerfile.j2", "groups": ["consul_instances"], "image": "dokken/ubuntu-22.04", "name": "ubuntu-22.04", "privileged": true, "volumes": ["/sys/fs/cgroup:/sys/fs/cgroup:rw"]}, "md5sum": "4251a75da8d6f7832b459c867339f429", "mode": "0600", "owner": "root", "size": 1266, "src": "/root/.ansible/tmp/ansible-tmp-1712065789.1587434-44-224359164378947/source", "state": "file", "uid": 0}, "msg": "Error building molecule_local/dokken/ubuntu-22.04 - code: 100, message: The command '/bin/sh -c if [ $(command -v apt-get) ]; then         if grep -q \"Debian GNU/Linux 11\" /etc/os-release; then             apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 python-apt-common && apt-get clean;         else             apt-get update && apt-get install -y python3 sudo bash ca-certificates iproute2 python-apt && apt-get clean;         fi     elif [ $(command -v dnf) ]; then         dnf makecache && dnf --assumeyes install /usr/bin/python3 /usr/bin/python3-config /usr/bin/dnf-3 sudo bash iproute && dnf clean all;     elif [ $(command -v yum) ]; then         yum makecache fast && yum install -y /usr/bin/python /usr/bin/python2-config sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all;     elif [ $(command -v zypper) ]; then         zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a;     elif [ $(command -v apk) ]; then         apk update && apk add --no-cache python sudo bash ca-certificates;     elif [ $(command -v xbps-install) ]; then         xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O;     fi' returned a non-zero code: 100, logs: ['Step 1/2 : FROM dokken/ubuntu-22.04', '', 'Pulling from dokken/ubuntu-22.04', 'Digest: sha256:98f006ec888ae0b82128364ec9ccb42fd22ba04737431bfa53dd39f7168ff15e', 'Status: Image is up to date for dokken/ubuntu-22.04:latest', ' ---> 72adbd7cab26', 'Step 2/2 : RUN if [ $(command -v apt-get) ]; then         if grep -q \"Debian GNU/Linux 11\" /etc/os-release; then             apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 python-apt-common && apt-get clean;         else             apt-get update && apt-get install -y python3 sudo bash ca-certificates iproute2 python-apt && apt-get clean;         fi     elif [ $(command -v dnf) ]; then         dnf makecache && dnf --assumeyes install /usr/bin/python3 /usr/bin/python3-config /usr/bin/dnf-3 sudo bash iproute && dnf clean all;     elif [ $(command -v yum) ]; then         yum makecache fast && yum install -y /usr/bin/python /usr/bin/python2-config sudo yum-plugin-ovl bash iproute && sed -i \\'s/plugins=0/plugins=1/g\\' /etc/yum.conf && yum clean all;     elif [ $(command -v zypper) ]; then         zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a;     elif [ $(command -v apk) ]; then         apk update && apk add --no-cache python sudo bash ca-certificates;     elif [ $(command -v xbps-install) ]; then         xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O;     fi', '', ' ---> Running in 92814e72d560', 'Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease', 'Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]', 'Hit:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease', 'Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]', 'Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1358 kB]', 'Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [2104 kB]', 'Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1920 kB]', 'Fetched 5611 kB in 1s (11.1 MB/s)', 'Reading package lists...', '', 'Reading package lists...', '', 'Building dependency tree...', '', 'Reading state information...', '', 'Package python-apt is not available, but is referred to by another package.', 'This may mean that the package is missing, has been obsoleted, or', 'is only available from another source', 'However the following packages replace it:', '  python-apt-doc python3-apt-dbg python3-apt python-apt-common', '', \"\\x1b[91mE: Package 'python-apt' has no installation candidate\", '\\x1b[0m', 'Removing intermediate container 92814e72d560']"}
  FAILED - RETRYING: [localhost]: Build an Ansible compatible image (new) (3 retries left).
  FAILED - RETRYING: [localhost]: Build an Ansible compatible image (new) (2 retries left).
Package python-apt is not available, but is referred to by another package.', 'This may mean that the package is missing, has been obsoleted, or', 'is only available from another source', 'However the following packages replace it:', '  python-apt-doc python3-apt-dbg python3-apt python-apt-common', '', \"\\x1b[91mE: Package 'python-apt' has no installation candidate\"

@slonopotamus
Copy link
Contributor Author

Oh, didn't notice that because it was collapsed. Now using python3-apt instead of python-apt.

Copy link
Contributor

@nre-ableton nre-ableton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @slonopotamus! 👍

@nre-ableton nre-ableton merged commit 29aa7fc into ansible-collections:master Apr 2, 2024
16 checks passed
@slonopotamus slonopotamus deleted the patch-1 branch April 2, 2024 15:02
isakrubin added a commit to car-info/ansible-consul that referenced this pull request Jun 10, 2024
* upstream/master:
  Remove deprecated molecule/centos-stream-8
  Fix rolling restart by waiting for consul leave and after restart
  Update molecule.yml
  --- (ansible-collections#597)
  Bump idna from 3.3 to 3.7 in the pip group across 1 directory (ansible-collections#596)
  Fix CI badge in README (ansible-collections#595)
  Fix ubuntu 22.04 molecule test to actually run on 22.04 (ansible-collections#594)
  feat: Configuration validation. fix ansible-collections#518 (ansible-collections#592)
  Fix error when creating gossip key (ansible-collections#558)
  adding become to service restarts (ansible-collections#571)
  Bump the pip group across 1 directories with 1 update (ansible-collections#590)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants