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

WIP: Update default molecule scenario + fix verify #12

Closed
wants to merge 2 commits into from

Conversation

jkirk
Copy link
Owner

@jkirk jkirk commented Sep 25, 2022

molecule test works locally, but fails for Debian/bullseye in the Github Action:

  TASK [ansible-role-base : Make sure ntp service is started] ********************
  fatal: [debian11]: FAILED! => {"changed": false, "msg": "Unable to start service chrony: Job for chrony.service failed because the control process exited with error code.\nSee \"systemctl status chrony.service\" and \"journalctl -xe\" for details.\n"}
  changed: [debian10]

Also see: geerlingguy/docker-debian11-ansible#4

Using geerlingguy/docker-debian10-ansible +
geerlingguy/docker-debian11-ansible in Ansible molecule currently do not
work with systemd, see: geerlingguy/docker-debian11-ansible#4.

Instead, took Dockfiles from @aussielunix (Thx!) found here (but removed
'Australia/Sydney' timezone):

* https://gitlab.com/aussielunix/ansible/molecule-containers/-/blob/main/debian/buster/Dockerfile
* https://gitlab.com/aussielunix/ansible/molecule-containers/-/blob/main/debian/bullseye/Dockerfile

Compare with @geerlingguy's current Dockerfiles:

* https://github.com/geerlingguy/docker-debian10-ansible/blob/6f6a1650421afc953eb11439db9e5dabcc4d3afe/Dockerfile
* https://github.com/geerlingguy/docker-debian11-ansible/blob/101602c7b9e7b3e100b7435eaa455b94189b2d47/Dockerfile

Note, that when using `dockerfile`, `image` seems to be needed too.
Used `docker.io/debian:$DISTRIBUTION-slim` for `image` as they are the
base images for @aussielunix's Dockerfiles.

I could have used @aussielinux gitlab container registry as `image`, but
currently 'debian:bullseye' is missing:

* https://gitlab.com/aussielunix/ansible/molecule-containers/container_registry/3343441

See: geerlingguy/docker-debian11-ansible#4 (comment)
To make `molecule verify` work, after we managed to get systemd working
in the docker container, we noticed that we had to update the example
chrony configuration files.

'gather_facts: true' has to be set, else 'ansible_distribution_release'
was undefined.
@jkirk
Copy link
Owner Author

jkirk commented Nov 7, 2022

A solution has been proposed, see: geerlingguy/docker-debian11-ansible#4 (comment) + ansible/molecule#3665 (comment):

  • Upgrade to molecule 4.0.3
  • Add cgroupns_mode: host
  • Change /sys/fs/cgroup:/sys/fs/cgroup:ro to /sys/fs/cgroup:/sys/fs/cgroup:rw

-> https://github.com/jkirk/ansible-role-base/blob/2c30fe9720d82c655ebcdb04282f150fd8ad6712/molecule/default/molecule.yml

jkirk added a commit that referenced this pull request Jun 23, 2023
systemd services used to fail (also in the Github Actions).
This seems to fix it as proposed in ansible/molecule#3665 (comment)

This replaces PR #12.
jkirk added a commit that referenced this pull request Jun 23, 2023
systemd services used to fail (also in the Github Actions).
This seems to fix it as proposed in ansible/molecule#3665 (comment)

This replaces PR #12.
jkirk added a commit that referenced this pull request Jun 23, 2023
systemd services used to fail (also in the Github Actions).
This seems to fix it as proposed in ansible/molecule#3665 (comment)

This replaces PR #12.
jkirk added a commit that referenced this pull request Jun 23, 2023
systemd services used to fail (also in the Github Actions).
This seems to fix it as proposed in ansible/molecule#3665 (comment)

This replaces PR #12.
@jkirk
Copy link
Owner Author

jkirk commented Jun 23, 2023

Decided to implement base_ntp_enable and set base_ntp_enable to false to overcome the systemd problem. Fixed via ca54f2e.

@jkirk jkirk closed this Jun 23, 2023
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.

1 participant