We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is no longer possible to set $Ansible.Result to an empty list, it gets changed to null. The problem started on v2.5.0.
$Ansible.Result
null
ansible [core 2.17.5] config file = /root/user1/my-repo/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.12/dist-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] (/usr/bin/python3.12) jinja version = 3.1.4 libyaml = True
# /usr/local/lib/python3.12/dist-packages/ansible_collections Collection Version --------------- ------- ansible.windows 2.5.0
- name: Reproduce bug in ansible.windows.win_powershell hosts: server_name.domain connection: psrp gather_facts: false tasks: - name: Set $Ansible.Result to an empty list ansible.windows.win_powershell: error_action: stop script: $Ansible.Result = @() register: script_result - name: Print result debug: var: script_result
result
{ "script_result": { "changed": true, "debug": [], "error": [], "failed": false, "host_err": "", "host_out": "", "information": [], "output": [], "result": [], "verbose": [], "warning": [] } }
{ "script_result": { "changed": true, "debug": [], "error": [], "failed": false, "host_err": "", "host_out": "", "information": [], "output": [], "result": null, "verbose": [], "warning": [] } }
The text was updated successfully, but these errors were encountered:
Sorry for the delay in responding. I've opened #711 which fixes this bug and returns the behavior back to how it was before.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
SUMMARY
It is no longer possible to set
$Ansible.Result
to an empty list, it gets changed tonull
. The problem started on v2.5.0.ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
OS / ENVIRONMENT
STEPS TO REPRODUCE
$Ansible.Result
to an empty listEXPECTED RESULTS
result
should be an empty list:ACTUAL RESULTS
result
is set tonull
The text was updated successfully, but these errors were encountered: