Merge "Added OvS permission workaround for enabling DPDK"
[apex-tripleo-heat-templates.git] / docker / docker-puppet.py
index 430aa88..01acde0 100755 (executable)
@@ -195,15 +195,17 @@ 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
 
         # Disables archiving
         if [ -z "$NO_ARCHIVE" ]; then
-            archivedirs=("/etc" "/root" "/var/lib/ironic/tftpboot" "/var/lib/ironic/httpboot" "/var/www")
+            archivedirs=("/etc" "/root" "/opt" "/var/lib/ironic/tftpboot" "/var/lib/ironic/httpboot" "/var/www" "/var/spool/cron")
             rsync_srcs=""
             for d in "${archivedirs[@]}"; do
                 if [ -d "$d" ]; then
@@ -216,12 +218,12 @@ 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
             # 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
+            tar -c -f - /var/lib/config-data/${NAME} --mtime='1970-01-01' | md5sum | awk '{print $1}' > /var/lib/config-data/${NAME}.md5sum
         fi
         """)
 
@@ -306,9 +308,9 @@ for config_volume in configs:
     volumes = service[4] if len(service) > 4 else []
 
     if puppet_tags:
-        puppet_tags = "file,file_line,concat,augeas,%s" % puppet_tags
+        puppet_tags = "file,file_line,concat,augeas,cron,%s" % puppet_tags
     else:
-        puppet_tags = "file,file_line,concat,augeas"
+        puppet_tags = "file,file_line,concat,augeas,cron"
 
     process_map.append([config_volume, puppet_tags, manifest, config_image, volumes])