no output from puppet apply host configuration in docker/deploy-steps-playbook.yaml

Bug #1707030 reported by James Slagle on 2017-07-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
High
James Slagle

Bug Description

With a container deloyment if the ansible task "Run puppet host configuration for step {{step}}" fails from docker/deploy-steps-playbook.yaml, you don't actually see any output or what the failure is because puppet apply is run with "--logdest syslog", so the error went to syslog. You'd have to ssh to the node and look in /var/log/messages to see how it actually failed.

Example output not showing the error, from my heat-config deployed notify json file:
[root@cinder-standalone-pump heat-config-ansible]# jq . ../deployed/eb0f2f42-4974-4386-b5f9-6f4d46372a01.notify.json
{
  "deploy_status_code": 2,
  "deploy_stderr": "",
  "deploy_stdout": "\nPLAY [localhost] ***************************************************************\n\nTASK [Gathering Facts] *********************************************************\nok: [localhost]\n\nTASK [Write the con
fig_step hieradata] *****************************************\nok: [localhost]\n\nTASK [Run puppet host configuration for step 1] ********************************\nok: [localhost]\n\nTASK [debug] ******************************
*************************************\nfatal: [localhost]: FAILED! => {\n \"(outputs.stderr|default('')).split('\\n')|union(outputs.stdout_lines|default([]))\": [\n \"\"\n ], \n \"changed\": false, \n \"fail
ed\": true, \n \"failed_when_result\": true\n}\n\tto retry, use: --limit @/var/lib/heat-config/heat-config-ansible/eb0f2f42-4974-4386-b5f9-6f4d46372a01_playbook.retry\n\nPLAY RECAP ******************************************
***************************\nlocalhost : ok=3 changed=0 unreachable=0 failed=1 \n\n"
}

Running stdout through jq we see:

[root@cinder-standalone-pump heat-config-ansible]# jq .deploy_stdout -r ../deployed/eb0f2f42-4974-4386-b5f9-6f4d46372a01.notify.json

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [Write the config_step hieradata] *****************************************
ok: [localhost]

TASK [Run puppet host configuration for step 1] ********************************
ok: [localhost]

TASK [debug] *******************************************************************
fatal: [localhost]: FAILED! => {
    "(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))": [
        ""
    ],
    "changed": false,
    "failed": true,
    "failed_when_result": true
}
        to retry, use: --limit @/var/lib/heat-config/heat-config-ansible/eb0f2f42-4974-4386-b5f9-6f4d46372a01_playbook.retry

PLAY RECAP *********************************************************************
localhost : ok=3 changed=0 unreachable=0 failed=1

So, the debug task whose intent is to show stdout showed nothing, and the error is not known.

Changed in tripleo:
status: New → In Progress
importance: Undecided → High
assignee: nobody → James Slagle (james-slagle)
milestone: none → pike-rc1

Reviewed: https://review.openstack.org/487964
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=8a8369d8688dab6eb719a640863397bfcb7d9316
Submitter: Jenkins
Branch: master

commit 8a8369d8688dab6eb719a640863397bfcb7d9316
Author: James Slagle <email address hidden>
Date: Thu Jul 27 13:59:04 2017 -0400

    Also log puppet output to console

    Running puppet apply with --logdest syslog results in all the output
    being redirected to syslog. You get no error messages. In the case where
    this ansible task fails, the subsequent debug task shows nothing useful
    as there was no stdout/stderr.

    Also pass --logdest console to puppet apply so that we get the output
    for the debug task. My local testing showed that when specifying logdest
    twice, both values were honored, and the output went to syslog and the
    console.

    Change-Id: Id5212b3ed27b6299e33e81ecf71ead554f9bdd29
    Closes-Bug: #1707030

Changed in tripleo:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/488345
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=6073155d624f33dae7146c1f35887290fd92a783
Submitter: Jenkins
Branch: master

commit 6073155d624f33dae7146c1f35887290fd92a783
Author: Bogdan Dobrelya <email address hidden>
Date: Fri Jul 28 11:25:42 2017 +0200

    Also log docker-puppet.py puppet output to console

    Running puppet apply with --logdest syslog results in all the output
    being redirected to syslog. You get no error messages. In the case where this fails, the subsequent debug task shows nothing useful
    as there was no stdout/stderr.

    Also pass --logdest console to docker-puppet's puppet apply so that
    we get the output for the debug task.

    Related-Bug: #1707030

    Change-Id: I67df5eee9916237420ca646a16e188f26c828c0e
    Signed-off-by: Bogdan Dobrelya <email address hidden>

This issue was fixed in the openstack/tripleo-heat-templates 7.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers