ansible-community / molecule-plugins

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

podman: remove ansible_async_dir setting logic #182

Closed grcancelliere closed 7 months ago

grcancelliere commented 11 months ago

fixes #181

https://github.com/ansible-community/molecule-plugins/commit/b5509a19465ba39cfedff0e6450524620a2d6d2f uses $USER to get the home for the current user, but if the controller does not run login(1), like in containers, the variable is not set. This PR uses whoami to get the current user.

EDIT Since the ansible_async_dir setting logic is not needed anymore (see https://github.com/ansible-community/molecule-plugins/pull/182#issuecomment-1807426732) this PR now removes it in create.yml and destroy.yml.

grcancelliere commented 10 months ago

@zhan9san since ansible.builtin.getent is not supported on OS X (#183) I was thinking about replacing it with a call to ansible.builtin.user with state: present to get the POSIX home without duplicating the logic. What do you prefer, a new commit, editing this commit or creating another PR?

zhan9san commented 8 months ago

@grcancelliere

Could you please remove the logic of setting ansible_async_dir?

This magic is introduced in https://github.com/ansible-community/molecule-podman/pull/139

The ~ and HOME has been the same in latest creater-ee image, in https://github.com/ansible/creator-ee/issues/19#issuecomment-1272566896.

$ docker run -it quay.io/ansible/creator-ee:latest /bin/bash
# echo $HOME
/home/runner
root@creator-ee:v0.21.0: /tmp
# echo ~root
/home/runner
root@creator-ee:v0.21.0: /tmp
# echo ~
/home/runner
root@creator-ee:v0.21.0: /tmp
# echo $HOME
/home/runner

Let me know if you have any concern @ssbarnea

grcancelliere commented 8 months ago

@zhan9san Sure, i'll change the PR this week. Thanks for the links.

zhan9san commented 7 months ago

@grcancelliere

Thanks for your contribution. You are doing great

jorhett commented 6 months ago

It's been 5 months since this was reported, and 2 months since this was merged. Can we get this fix pushed out please?

dhoppe commented 5 months ago

@grcancelliere This issue still exists, because the new release is not available via pip.

❯ python3 -m pip list | grep molecule-plugins
────────────────────────────────────────────────────────────────────────────────
     STDIN
  23 mdurl                     0.1.2
  24 molecule                  6.0.3
  25 molecule-plugins          23.5.0
  26 mypy-extensions           1.0.0
  27 netaddr                   0.9.0
────────────────────────────────────────────────────────────────────────────────

https://pypi.org/project/molecule-plugins/

It looks like the GitHub action failed. This is related to #228

https://github.com/ansible-community/molecule-plugins/actions/runs/7529883395