aboutsummaryrefslogtreecommitdiffstats
path: root/docker/docker-puppet.py
diff options
context:
space:
mode:
authorMartin André <m.andre@redhat.com>2017-06-21 16:02:55 +0200
committerMartin André <m.andre@redhat.com>2017-07-10 11:13:25 +0200
commitcf18e865d14adc319b6c2dfafd650f32dad4d853 (patch)
tree86231cde72c4adb55d4e06e1a8f17836dea834de /docker/docker-puppet.py
parent766de0cacb18171264d2a699ac48cacb8d35a152 (diff)
Copy only generated puppet files into the container
This solves a problem with bind-mounts when the containers are holding files descriptors open. At the same time this makes the template more robust to puppet changes since new config files will be available in the containers without needing to update the templates. Partial-Bug: #1698323 Change-Id: Ia4ad6d77387e3dc354cd131c2f9756939fb8f736
Diffstat (limited to 'docker/docker-puppet.py')
-rwxr-xr-xdocker/docker-puppet.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/docker/docker-puppet.py b/docker/docker-puppet.py
index 7ca63337..65d3bf38 100755
--- a/docker/docker-puppet.py
+++ b/docker/docker-puppet.py
@@ -195,9 +195,11 @@ def mp_puppet_config((config_volume, puppet_tags, manifest, config_image, volume
TAGS="--tags \"$PUPPET_TAGS\""
fi
- # workaround LP1696283
- mkdir -p /etc/ssh
- touch /etc/ssh/ssh_known_hosts
+ # Create a reference timestamp to easily find all files touched by
+ # puppet. The sync ensures we get all the files we want due to
+ # different timestamp.
+ touch /tmp/the_origin_of_time
+ sync
FACTER_hostname=$HOSTNAME FACTER_uuid=docker /usr/bin/puppet apply --verbose $TAGS /etc/config.pp
@@ -216,7 +218,7 @@ def mp_puppet_config((config_volume, puppet_tags, manifest, config_image, volume
# This is useful for debugging
mkdir -p /var/lib/config-data/puppet-generated/${NAME}
rsync -a -R -0 --delay-updates --delete-after \
- --files-from=<(find $rsync_srcs -newer /etc/ssh/ssh_known_hosts -print0) \
+ --files-from=<(find $rsync_srcs -newer /tmp/the_origin_of_time -not -path '/etc/puppet*' -print0) \
/ /var/lib/config-data/puppet-generated/${NAME}
# Write a checksum of the config-data dir, this is used as a