ansible-community / molecule-plugins

Collection on molecule plugins
MIT License
101 stars 67 forks source link

podman containers break on Get passwd entries for USER env #181

Closed lod closed 7 months ago

lod commented 11 months ago

Release v23.5.0 includes the commit https://github.com/ansible-community/molecule-plugins/commit/b5509a19465ba39cfedff0e6450524620a2d6d2f

This causes the following error

Molecule default > destroy 00:01
PLAY [Destroy] *****************************************************************
TASK [Get passwd entries for USER env] *****************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "One or more supplied key could not be found in the database."}

I believe the root of this is that the USER variable is not set.

lod commented 11 months ago

It looks like all the github tests are run using tox, and the USER variable was specifically added to the tox config in this commit so that those tests passed.

grcancelliere commented 11 months ago

@lod can you describe your environment? I'll change that part to get the user home even if $USER is not set

grcancelliere commented 11 months ago

@lod I'm sorry for breaking your workflow, the PR I'm currently writing uses whoami instead of $USER, is it available in your environment?

lod commented 10 months ago

Thanks for looking at this @grcancelliere, Sorry I didn't respond promptly

whoami will work fantastically

My environment is a gitlab runner executing a basic Debian container.

# env
HOSTNAME=a8d732721bfc
PWD=/
container=podman
HOME=/root
TERM=xterm
SHLVL=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
ng-bsy commented 5 months ago

@zhan9san When will the fix for this be released? https://github.com/ansible/creator-ee is using molecule-plugins 23.5.0 since v0.20.0 and causing molecule tests to fail