You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ansible-galaxy collection list community.docker
# /home/user/.venvs/ansible/lib/python3.12/site-packages/ansible_collections
Collection Version
---------------- -------
community.docker 4.0.1
CONFIGURATION
ansible-config dump --only-changed
CONFIG_FILE() = /home/user/workspace/project/ansible.cfg
DEFAULT_GATHERING(/home/user/workspace/project/ansible.cfg) = smart
DEFAULT_MANAGED_STR(/home/user/workspace/project/ansible.cfg) = # This is an ansible managed configuration, do not edit it manually as it will be overwrited automatically.
DEFAULT_TRANSPORT(/home/user/workspace/project/ansible.cfg) = smart
HOST_KEY_CHECKING(/home/user/workspace/project/ansible.cfg) = False
RETRY_FILES_ENABLED(/home/user/workspace/project/ansible.cfg) = False
GALAXY_SERVERS:
OS / ENVIRONMENT
Ubuntu 22.04.5 LTS.
STEPS TO REPRODUCE
Just create a task used to retrieve docker host info.
- name: Get info on docker hostcommunity.docker.docker_host_info:
register: resultfailed_when: not result.can_talk_to_docker
EXPECTED RESULTS
the result registered fact should contain can_talk_to_docker boolean value both on success and/or on error.
ACTUAL RESULTS
fatal: [host.domain.tld]: FAILED! => {
"msg":
"The task includes an option with an undefined variable.. 'dict object' has no attribute 'can_talk_to_docker'
The error appears to be in '/home/user/workspace/project/site.yml': line 23, column 11, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
rescue:
- name: "Get info on docker host"
^ here"
}
I think it comes from the fact that as you only include the fail_result dict when the client fails (when client.fail() is called).
The main function try/catch should inject the dict result on success like this I guess?
file: docker_host_info.py
This looks like an oversight! It should be fixable as you suggest, though I'd like to also check whether the assignment in line 366 is really OK. I should manage to do that tomorrow.
SUMMARY
When using docker_host_info module in order to check if the host have a working docker instance, like this:
the result output never contain expected
result.can_to_docker
element and fail.ISSUE TYPE
COMPONENT NAME
module: docker_host_info
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 22.04.5 LTS.
STEPS TO REPRODUCE
Just create a task used to retrieve docker host info.
EXPECTED RESULTS
the result registered fact should contain can_talk_to_docker boolean value both on success and/or on error.
ACTUAL RESULTS
I think it comes from the fact that as you only include the fail_result dict when the client fails (when client.fail() is called).
The main function try/catch should inject the dict result on success like this I guess?
file: docker_host_info.py
The text was updated successfully, but these errors were encountered: