Replace outdated instruction with link to upstream doc
[apex-tripleo-heat-templates.git] / extraconfig / tasks / run_puppet.sh
1 #!/bin/bash
2
3 function run_puppet {
4     set -eux
5     local manifest="$1"
6     local role="$2"
7     local step="$3"
8     local rc=0
9
10     export FACTER_deploy_config_name="${role}Deployment_Step${step}"
11     if [ -e "/etc/puppet/hieradata/heat_config_${FACTER_deploy_config_name}.json" ]; then
12         set +e
13         puppet apply --detailed-exitcodes \
14                --modulepath \
15                /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules \
16                "${manifest}"
17         rc=$?
18         echo "puppet apply exited with exit code $rc"
19     else
20         echo "Step${step} doesn't exist for ${role}"
21     fi
22     set -e
23
24     if [ $rc -eq 2 -o $rc -eq 0 ]; then
25         set +xu
26         return 0
27     fi
28     set +xu
29     return $rc
30 }