ansible-community / molecule-plugins

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

Revert "podman: remove ansible_async_dir setting logic (#182)" #237

Open hswong3i opened 4 months ago

hswong3i commented 4 months ago

After upgrade to https://github.com/ansible-community/molecule-plugins/releases/tag/v23.5.3, I found that all my GitLab CI pipiline running with podman driver not working (e.g. https://gitlab.com/alvistack/docker-ubuntu/-/jobs/6148073273)

INFO     Running ubuntu-22.04-docker > destroy
Molecule ubuntu-22.04-docker > destroy 00:03
PLAY [Destroy] *****************************************************************
TASK [Destroy molecule instance(s)] ********************************************
changed: [localhost] => (item={'image': 'alvistack/ubuntu-22.04', 'name': 'eet3ufiemeeh-1', 'pre_build_image': True, 'privileged': True})
TASK [Wait for instance(s) deletion to complete] *******************************
failed: [localhost] (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': 'j345359959033.3993', 'results_file': '/home/vagrant/.ansible_async/j345359959033.3993', 'changed': True, 'item': {'image': 'alvistack/ubuntu-22.04', 'name': 'eet3ufiemeeh-1', 'pre_build_image': True, 'privileged': True}, 'ansible_loop_var': 'item'}) => {"ansible_job_id": "j345359959033.3993", "ansible_loop_var": "item", "attempts": 1, "changed": false, "finished": 1, "item": {"ansible_job_id": "j345359959033.3993", "ansible_loop_var": "item", "changed": true, "failed": 0, "finished": 0, "item": {"image": "alvistack/ubuntu-22.04", "name": "eet3ufiemeeh-1", "pre_build_image": true, "privileged": true}, "results_file": "/home/vagrant/.ansible_async/j345359959033.3993", "started": 1}, "msg": "could not find job", "results_file": "/root/.ansible_async/j345359959033.3993", "started": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

After debug I found that if disable https://github.com/ansible-community/molecule-plugins/blob/v23.5.3/src/molecule_plugins/podman/playbooks/create.yml#L167-L168 as below, the create will working fine:

    - name: Create molecule instance(s)
      containers.podman.podman_container:
      ...
      loop_control:
        label: "{{ item.name }}"      
      # async: 7200
      # poll: 0
      ---

So this lead me to the https://github.com/ansible-community/molecule-plugins/pull/182, which remove the ansible_async_dir logic.

After manually revert the commit https://github.com/ansible-community/molecule-plugins/commit/0244719340dbe33893e82e2f7fc7731365796285, my problem get fixed:

This reverts commit 0244719340dbe33893e82e2f7fc7731365796285.

github-actions[bot] commented 4 months ago

Label error. Requires exactly 1 of: bug, enhancement, major, minor, patch, skip-changelog. Found: