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
Which ansible version are you using?
ansible 2.10.5
config file = ??/.ansible.cfg
configured module search path = ['??/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = ??/.local/lib/python3.8/site-packages/ansible
executable location = ??/.local/bin/ansible
python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
Which go version are you using?
go version go1.15.6 linux/amd64
Which go-ansbile version are you using?
0.7.0
What did you see?
When is run a playbook using the json stdout_callbak, and there is a warning message on the output (with warning messages I mean those messages that start with [WARNING]), that message is included on json data and then the parsing done by JSONParse fails.
exit status 4
panic: Unmarshall error
invalid character '[' after top-level value
On the other hand, some warning messages returned by ansible-playbook in one line on terminal are seen as multiple line messages by go-ansible
Thats an example:
Shell output:
$ ANSIBLE_STDOUT_CALLBACK=json ansible-playbook --inventory 127.0.0.1, --user apenella site.yml
[WARNING]: Unhandled error in Python interpreter discovery for host 127.0.0.1: Failed to connect to the host via ssh: ssh: connect to host 127.0.0.1 port 22: Connection refused
...
go-ansible output:
-- #[WARNING]: Unhandled error in Python interpreter discovery for host 127.0.0.1:#
-- #Failed to connect to the host via ssh: ssh: connect to host 127.0.0.1 port 22:#
-- #Connection refused#
On DefaultExecutor is created a multireader for stdout and stderr, then the stdout and stderr output is written on same writer and that causes an invalid json outcome when there is a warning message during playbook execution.
Which ansible version are you using?
ansible 2.10.5
config file = ??/.ansible.cfg
configured module search path = ['??/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = ??/.local/lib/python3.8/site-packages/ansible
executable location = ??/.local/bin/ansible
python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
Which go version are you using?
go version go1.15.6 linux/amd64
Which go-ansbile version are you using?
0.7.0
What did you see?
When is run a playbook using the json stdout_callbak, and there is a warning message on the output (with warning messages I mean those messages that start with
[WARNING]
), that message is included on json data and then the parsing done by JSONParse fails.On the other hand, some warning messages returned by
ansible-playbook
in one line on terminal are seen as multiple line messages bygo-ansible
Thats an example:
How to reproduce the issue?
To reproduce the issue I used simple-ansibleplaybook-json example.
I forced a connection error updating ansiblePlaybookConnectionOptions definition as is shown below:
You could see the scanned text by
go-ansible
updating ansiblePlaybookJSONResults as is shown below:The issue is related to #23
The text was updated successfully, but these errors were encountered: