docker-puppet.py: used dedicated hiera entry, not uuid

Currently it is not possible to do per-node customization inside
docker-puppet.py because it overrides the fact 'uuid'.

This change adds a dedicated docker_puppet entry in hiera.yaml so that
docker-puppet.py needs to do nothing special for
/etc/puppet/hieradata/docker_puppet.json to be included in the hiera
merge.

Change-Id: Icf37dcd63e0152ee15e9f0079b45e31a4f8d9fbb
Depends-On: https://review.openstack.org/#/c/605478/
Closes-Bug: #1761624
This commit is contained in:
Steve Baker 2018-04-06 11:05:33 +12:00 committed by David J Peacock
parent 4656dbe2e0
commit 6bbc3b51df
3 changed files with 7 additions and 4 deletions

View File

@ -245,7 +245,7 @@ with open(sh_script, 'w') as script_file:
mkdir -p /etc/puppet mkdir -p /etc/puppet
cp -a /tmp/puppet-etc/* /etc/puppet cp -a /tmp/puppet-etc/* /etc/puppet
rm -Rf /etc/puppet/ssl # not in use and causes permission errors rm -Rf /etc/puppet/ssl # not in use and causes permission errors
echo "{\\"step\\": $STEP}" > /etc/puppet/hieradata/docker.json echo "{\\"step\\": $STEP}" > /etc/puppet/hieradata/docker_puppet.json
TAGS="" TAGS=""
if [ -n "$PUPPET_TAGS" ]; then if [ -n "$PUPPET_TAGS" ]; then
TAGS="--tags \"$PUPPET_TAGS\"" TAGS="--tags \"$PUPPET_TAGS\""
@ -263,7 +263,8 @@ with open(sh_script, 'w') as script_file:
if [ "$NET_HOST" == "false" ]; then if [ "$NET_HOST" == "false" ]; then
export FACTER_hostname=$HOSTNAME export FACTER_hostname=$HOSTNAME
fi fi
export FACTER_uuid=docker # $::deployment_type in puppet-tripleo
export FACTER_deployment_type=containers
/usr/bin/puppet apply --summarize \ /usr/bin/puppet apply --summarize \
--detailed-exitcodes \ --detailed-exitcodes \
--color=false \ --color=false \

View File

@ -64,8 +64,9 @@ outputs:
# ignore copy failures as these may be the same file depending on docker mounts # ignore copy failures as these may be the same file depending on docker mounts
cp -a /tmp/puppet-etc/* /etc/puppet || true cp -a /tmp/puppet-etc/* /etc/puppet || true
fi fi
echo "{\"step\": ${STEP}}" > /etc/puppet/hieradata/docker.json echo "{\"step\": ${STEP}}" > /etc/puppet/hieradata/docker_puppet.json
export FACTER_uuid=docker # $::deployment_type in puppet-tripleo
export FACTER_deployment_type=containers
set +e set +e
puppet apply $EXTRA_ARGS \ puppet apply $EXTRA_ARGS \
--verbose \ --verbose \

View File

@ -664,6 +664,7 @@ resources:
config: config:
hierarchy: hierarchy:
- '"%{::uuid}"' - '"%{::uuid}"'
- docker_puppet # Optionally provided by docker-puppet.py
- heat_config_%{::deploy_config_name} - heat_config_%{::deploy_config_name}
- config_step - config_step
- {{role.name.lower()}}_extraconfig - {{role.name.lower()}}_extraconfig