Add --detailed-exitcodes when running puppet via ansible
[apex-tripleo-heat-templates.git] / common / deploy-steps-tasks.yaml
index 785095b..79a8bc8 100644 (file)
       command: >-
         puppet apply {{ host_puppet_config_debug|default('') }}
         --modulepath=/etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
+        --detailed-exitcodes
         --logdest syslog --logdest console --color=false
         /var/lib/tripleo-config/puppet_step_config.pp
-      changed_when: false
+      changed_when: outputs.rc == 2
       check_mode: no
       register: outputs
       failed_when: false
       no_log: true
     - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
       when: outputs is defined
-      failed_when: outputs|failed
+      failed_when: outputs.rc not in [0, 2]
     ######################################
     # Generate config via docker-puppet.py
     ######################################