Skip to content

Make role compatible with Podman #66

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gotmax23
Copy link

@gotmax23 gotmax23 commented May 22, 2022


name: Make role compatible with Podman
about: See below


Describe the change
This patch passes the raw command to install packages through /bin/sh. Otherwise, when running this role against a podman container using the podman connection plugin, podman tries to find an executable in the $PATH named LANG=C and fails.

Testing
In case a feature was added, how were tests performed?

I tested this using molecule test with the following patch applied to molecule/default/molecule.yml

diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
index 1e24c87..af08020 100644
--- a/molecule/default/molecule.yml
+++ b/molecule/default/molecule.yml
@@ -12,14 +12,11 @@ lint: |
   yamllint .
   ansible-lint
 driver:
-  name: docker
+  name: podman
 platforms:
   - name: "bootstrap-${image:-fedora}-${tag:-latest}${TOX_ENVNAME}"
     image: "${namespace:-robertdebock}/${image:-fedora}:${tag:-latest}"
     command: /sbin/init
-    volumes:
-      - /sys/fs/cgroup:/sys/fs/cgroup:ro
-    privileged: yes
     pre_build_image: yes
 provisioner:
   name: ansible

@robertdebock
Copy link
Owner

Cool, let's wait what CI-tests results in, but looks promising.

@gotmax23
Copy link
Author

@robertdebock, can you please take a look?

JonasPammer added a commit to JonasPammer/ansible-role-bootstrap that referenced this pull request Aug 31, 2022
JonasPammer added a commit to JonasPammer/ansible-role-bootstrap that referenced this pull request Aug 31, 2022
JonasPammer added a commit to JonasPammer/ansible-role-bootstrap that referenced this pull request Sep 3, 2022
* chore: copy molecule/default -> molecule/podman

* ci: make molecule podman scenario use podman as driver

copied how to adapt from robertdebock/ansible-role-bootstrap#66 (comment)

* test: add molecule[podman] in tox dependencies

* fix: add executable argument to install bootstrap packages (raw) task to fix podman

without this, following error appears: Error: executable file  not found in /home/jonas/Dokumente/Programmieren/public/ansible-roles/all-repos/ansible-role-bootstrap/venv/bin:/home/jonas/.nvm/versions/node/v16.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/jonas/.local/share/JetBrains/Toolbox/scripts:/home/jonas/.local/share/JetBrains/Toolbox/scripts:/usr/local/go/bin: No such file or directory: OCI runtime attempted to invoke a command that was not found

* refactor: prepend 'podman' to name of docker container in molecule podman scenario

* docs: add podman to development machine dependencies

* ci: add pause in podman converge playbook

in an attempt to understand or fix random CI failures

* revert: revert everything except actual tasks/main.yml

molecule podman ci tests are scuffed. podman installation is scuffed too. gonna stay away from podman for a while after this encounter lol

Co-authored-by: JonasPammer <[email protected]>
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.

2 participants