-
Task
-
Resolution: Done
-
Normal
-
None
-
3
-
False
-
-
False
-
None
-
Unset
-
None
We need an automated test to catch regressions in the playbook-dispatcher output handling. The stdout processing logic has been modified to add a newline to the stdout line if EndLine > StartLine. Code change can be seen here: https://github.com/RedHatInsights/playbook-dispatcher/commit/ef900cc4912af58805d3e60dc8bd680499e40d74
We could take one of the examples used in the unit tests and send that through the upload service....which would trigger the response-validator and response-consumer to process the messages and update the stdout in the database. The test could then pull the data from the database through the REST api and verify it looks correct.
Info from original ticket:
Remediations incorrectly handles newlines in playbook output.
Here's an example of valid ansible-playbook output from a RHEL 8.6 host:
[root@jaudet-laptop-rhel86-vmlib ~]# ANSIBLE_COLLECTIONS_PATH=/usr/share/rhc-worker-playbook/ansible/collections/ansible_collections/ ansible-playbook playbook.yml -i localhost, --connection=local PLAY [Set owner and permissions on /etc/sshd/sshd_config to root:root 0600] ********************** TASK [Gathering Facts] *************************************************************************** ok: [localhost] TASK [Set the owner and permissions of ssh config file to root:root 0600] ************************ ok: [localhost] PLAY [run insights] ****************************************************************************** TASK [run insights] ****************************************************************************** ok: [localhost] PLAY RECAP *************************************************************************************** localhost : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Here's what's displayed for an RHC-connect RHEL 8.6 host w/stage:
[WARNING]: provided hosts list is empty, only localhost is available. Note thatthe implicit localhost does not match 'all' PLAY [Set owner and permissions on /etc/sshd/sshd_config to root:root 0600] **** TASK [Gathering Facts] *********************************************************ok: [localhost] TASK [Set the owner and permissions of ssh config file to root:root 0600] ******changed: [localhost] PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Here's what's displayed for a Satellite 6.10-connected host w/stage (w/receptor):
[WARNING]: Callback disabled by environment. Disabling the Foreman callback plugin. PLAY [Set owner and permissions on /etc/sshd/sshd_config to root:root 0600] **** TASK [Gathering Facts] ********************************************************* ok: [ci-vm-10-0-132-35.hosted.upshift.rdu2.redhat.com] TASK [Set the owner and permissions of ssh config file to root:root 0600] ****** changed: [ci-vm-10-0-132-35.hosted.upshift.rdu2.redhat.com] PLAY [run insights] ************************************************************ TASK [run insights] ************************************************************ ok: [ci-vm-10-0-132-35.hosted.upshift.rdu2.redhat.com] PLAY RECAP ********************************************************************* ci-vm-10-0-132-35.hosted.upshift.rdu2.redhat.com : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0Exit status: 0
- clones
-
RHCLOUD-36644 RHC mangles newlines in playbook output
-
- Closed
-
- mentioned on