diff options
author | Martin André <m.andre@redhat.com> | 2017-06-16 10:10:54 +0200 |
---|---|---|
committer | Martin André <m.andre@redhat.com> | 2017-06-16 16:09:17 +0200 |
commit | 74595a73210bb9cf5e0d688c57e9fa5423422603 (patch) | |
tree | 89952ce23c89d044c98ca873598ad95617031f86 /docker | |
parent | 6e72aa9f8157a57dfe4db7bc0a5defb86d800ea6 (diff) |
Make a copy of files touched by puppet in container
This should help determine what exactly needs to be bind mounted in the
container and should also help limit the size of collected logs in CI,
as collecting the entire /etc directory from each container can grow
pretty quickly in size and is not that useful.
Related-Bug: #1698172
Change-Id: Ie2bded39cdb82a72f0c28f1c552403cd11b5af45
Diffstat (limited to 'docker')
-rwxr-xr-x | docker/docker-puppet.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docker/docker-puppet.py b/docker/docker-puppet.py index 4d9d40d4..13211676 100755 --- a/docker/docker-puppet.py +++ b/docker/docker-puppet.py @@ -208,6 +208,13 @@ def mp_puppet_config((config_volume, puppet_tags, manifest, config_image, volume done rsync -a -R --delay-updates --delete-after $rsync_srcs /var/lib/config-data/${NAME} + # Also make a copy of files modified during puppet run + # 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) \ + / /var/lib/config-data/puppet-generated/${NAME} + # Write a checksum of the config-data dir, this is used as a # salt to trigger container restart when the config changes tar cf - /var/lib/config-data/${NAME} | md5sum | awk '{print $1}' > /var/lib/config-data/${NAME}.md5sum |