'could not find job' on async_status with delegate_to localhost #81805
Labels
affects_2.15
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
P3
Priority 3 - Approved, No Time Limitation
Summary
async_status is looking at a different place for the async_dir as it actually is when the actual async task and async_status are delegated to localhost, HOME environment variable is explicitly set and ANSIBLE_ASYNC_DIR is not explicitly set.
I think the bug lies somewhere in the
_remote_expand_user
function of the async_module which has its own logic to expand the~
in the path while async_wrapper usesos.path.expanduser
to do that.I first discovered the issue while using ansible-semaphore: semaphoreui/semaphore#943
Issue Type
Bug Report
Component Name
async_status
Ansible Version
Configuration
OS / Environment
arch Linux and Ubuntu 20.04
Steps to Reproduce
Test Playbook (
async-delegate.yml
):Command:
HOME=/tmp/foo ansible-playbook -i example.host, async-delegate.yml --verbose
Expected Results
The playbook should run without errors, retrying max. 7 times until the sleep command is finished. And this is the case for the following variants:
ansible-playbook -i example.host, async-delegate.yml
ANSIBLE_ASYNC_DIR=/tmp/bar HOME=/tmp/foo ansible-playbook -i example.host, async-delegate.yml
Actual Results
The text was updated successfully, but these errors were encountered: