Description of problem: running an ansible playbook with a debug task. The previous task succeeds before the debug task fails. The debug task runs successfully if the ansible_password variable is in plaintext, but if a vault string is used then the task fails Example playbook: --- - name: facts hosts: nxos gather_facts: false tasks: - name: facts task nxos_facts: gather_subset: all register: switch_facts - name: debug debug: var: switch_facts.ansible_net_interfaces group_vars/nxos.yml --- ansible_connection: network_cli ansible_network_os: nxos ansible_user: admin ansible_password: !vault | $ANSIBLE_VAULT;1.1;AES256 33333331326439366162623437316562633834306630356366306464356536366437303963643639 3162623838623362316565663031353339353731316437630a653936313932386333356139313766 39343064313635396634633837636666316430363562616337633161323633633739393235633462 3832383266316263320a356631656566653366643830303838636332386636326432303830666463 3536 Version-Release number of selected component: ansible-2.7.7-1.fc29 Additional info: reporter: libreport-2.10.0 cmdline: /usr/bin/python3 /usr/bin/ansible-connection 8480 crash_function: default exception_type: TypeError executable: /usr/bin/ansible-connection interpreter: python3-3.7.2-4.fc29.x86_64 kernel: 4.20.8-200.fc29.x86_64 runlevel: N 5 type: Python3 uid: 4400 Truncated backtrace: encoder.py:179:default:TypeError: Object of type AnsibleVaultEncryptedUnicode is not JSON serializable Traceback (most recent call last): File "/usr/bin/ansible-connection", line 328, in <module> main() File "/usr/bin/ansible-connection", line 294, in main conn.set_options(var_options=variables) File "/usr/lib/python3.7/site-packages/ansible/module_utils/connection.py", line 167, in __rpc__ response = self._exec_jsonrpc(name, *args, **kwargs) File "/usr/lib/python3.7/site-packages/ansible/module_utils/connection.py", line 144, in _exec_jsonrpc data = json.dumps(req) File "/usr/lib64/python3.7/json/__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "/usr/lib64/python3.7/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib64/python3.7/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/usr/lib64/python3.7/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type AnsibleVaultEncryptedUnicode is not JSON serializable Local variables in innermost frame: self: <json.encoder.JSONEncoder object at 0x7f4b7b16e908> o: 'redhat'
Created attachment 1536799 [details] File: backtrace
Created attachment 1536800 [details] File: cgroup
Created attachment 1536801 [details] File: cpuinfo
Created attachment 1536802 [details] File: environ
Created attachment 1536803 [details] File: mountinfo
Created attachment 1536804 [details] File: namespaces
Created attachment 1536805 [details] File: open_fds
Would you be willing to file this upstream at github? Or would you prefer I do so?
I've filed the issue upstream. https://github.com/ansible/ansible/issues/52860
FEDORA-2019-355f9240c5 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-355f9240c5
FEDORA-2019-5f9a9b20f3 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-5f9a9b20f3
ansible-2.8.6-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-a9195834a9
ansible-2.8.6-1.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-355f9240c5
ansible-2.8.6-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-5f9a9b20f3
This message is a reminder that Fedora 29 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '29'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 29 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
FEDORA-2019-a9195834a9 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-a9195834a9
ansible-2.8.6-1.fc30, ansible-lint-4.1.1a0-4.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-a9195834a9
ansible-2.8.6-1.fc31, ansible-lint-4.1.1a0-4.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-355f9240c5
ansible-2.8.6-1.fc29, ansible-lint-4.1.1a0-4.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-5f9a9b20f3
ansible-2.8.6-1.fc31, ansible-lint-4.1.1a0-4.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.
ansible-2.8.6-1.fc29, ansible-lint-4.1.1a0-4.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.