molecule
molecule copied to clipboard
Support for cgroupns parameter
So that values like --cgroupns=host can be used to spin up container with systemd support.
iirc, schemas fixes should be opened here : https://github.com/ansible/schemas.
iirc, schemas fixes should be opened here : https://github.com/ansible/schemas.
Could you point me to the correct schema for Molecule drivers?
iirc, schemas fixes should be opened here : https://github.com/ansible/schemas.
Could you point me to the correct schema for Molecule drivers?
I have submitted a PR here
@apatard
iirc, schemas fixes should be opened here : https://github.com/ansible/schemas.
Per ssbarnea in this PR, https://github.com/ansible-community/molecule/pull/3638#issuecomment-1220521423
I do totally agree that we should move some of the schemas inside the projects themselves. In fact I was planning to do the same for ansible-lint and ansible-navigator, as these are quite simple. There is no more authoritative source for managing a schema than the project using it.
@bngsudheer Could you help create some examples of container using cgroupv2 in molecule repo?
https://github.com/ansible-community/molecule/blob/main/docs/examples.rst#systemd-container? Related to https://github.com/ansible-community/molecule-docker/pull/166#issuecomment-1235689840
@apatard
iirc, schemas fixes should be opened here : https://github.com/ansible/schemas.
Per ssbarnea in this PR, #3638 (comment)
I do totally agree that we should move some of the schemas inside the projects themselves. In fact I was planning to do the same for ansible-lint and ansible-navigator, as these are quite simple. There is no more authoritative source for managing a schema than the project using it.
@bngsudheer Could you help create some examples of container using cgroupv2 in molecule repo?
https://github.com/ansible-community/molecule/blob/main/docs/examples.rst#systemd-container? Related to ansible-community/molecule-docker#166 (comment)
I am still testing the issue and some potential resolutions. So far, I have managed to get it to work with some Ubuntu versions. Once, I am through the tests, I will send some PRs for the documentation. Please bear with me till then.
@bngsudheer
Are you sure it is cgroupns
instead of cgroupns_mode
?
Reference: https://github.com/ansible-collections/community.docker/blob/1e93feed2b9f34f3af4885d878c5dde1f51d206c/plugins/modules/docker_container.py#L51-L59
Here is what I test in https://github.com/ansible-community/molecule-docker/pull/166#issuecomment-1235689840
❯ cat molecule/default/molecule.yml
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: instance
image: geerlingguy/docker-debian11-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
pre_build_image: true
privileged: true
cgroupns_mode: host
provisioner:
name: ansible
verifier:
name: ansible
@bngsudheer
Are you sure it is
cgroupns
instead ofcgroupns_mode
?Reference: https://github.com/ansible-collections/community.docker/blob/1e93feed2b9f34f3af4885d878c5dde1f51d206c/plugins/modules/docker_container.py#L51-L59
Here is what I test in ansible-community/molecule-docker#166 (comment)
❯ cat molecule/default/molecule.yml --- dependency: name: galaxy driver: name: docker platforms: - name: instance image: geerlingguy/docker-debian11-ansible:latest command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw pre_build_image: true privileged: true cgroupns_mode: host provisioner: name: ansible verifier: name: ansible
I have realized after the PR merge that it should be cgroupns_mode
instead of cgroupns
. Apparently, cgroupns
is the docker CLI argument. Even with cgroupns_mode
, I see it failing on fresh install of Ubuntu 22.04. Surprisingly, on a laptop with Ubuntu 22.04 which was upgraded from an older version, it is working. I am still testing things out.
Is this this needed? If so please fix conflicts so we can merge it.
Closing due to lack of updates