Add --detailed-exitcodes when running puppet via ansible
authorMichele Baldessari <michele@acksyn.org>
Thu, 12 Oct 2017 15:37:50 +0000 (17:37 +0200)
committerSofer Athlan-Guyot <sathlang@redhat.com>
Wed, 8 Nov 2017 15:36:32 +0000 (16:36 +0100)
commit0ae06e10e1db3e25655fc392736248deff6516c1
tree62a48c52f1bfe7516c7122bd01bf404f8d4044ab
parent2e286ecee218d325b7dea19957da1734e81d1d30
Add --detailed-exitcodes when running puppet via ansible

puppet run on never fails, even when it should, since we moved
to the ansible way of applying it. The reason is the current following code:

    - name: Run puppet host configuration for step {{step}}
      command: >-
        puppet apply
        --modulepath=/etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
        --logdest syslog --logdest console --color=false
        /var/lib/tripleo-config/puppet_step_config.pp

The above is missing the --detailed-exitcodes switch and so puppet will never
really error out on us and the deployment will keep on running all the
steps even though a previous puppet manifest might have failed. This
cause extra hard-to-debug failures.

Initially the issue was observed on the puppet host runs, but this
parameter is missing also from docker-puppet.py, so let's add it there
as well as it makes sense to return proper error codes whenever we call
puppet.

Besides this being a good idea in general, we actually *have* to do it
because puppet does not fail correctly without this option due to the
following puppet bug:
https://tickets.puppetlabs.com/browse/PUP-2754

Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
Change-Id: Ie9df4f520645404560a9635fb66e3af42b966f54
Closes-Bug: #1723163
(cherry picked from commit 11e599d116cfbf7df4dcd0e7670c3405a4224c1a)
common/deploy-steps-tasks.yaml
docker/docker-puppet.py