diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-11-21 18:44:49 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-11-21 18:47:19 +0000 |
commit | 883f2abb51f460f3227dc7d4b330cceff3e96150 (patch) | |
tree | c569f6cfc317a398c6c80136069c0d0b1395769c | |
parent | 5e2d2210559e74812ed116f399c6e588649b17a2 (diff) | |
download | infrastructure-883f2abb51f460f3227dc7d4b330cceff3e96150.tar.gz |
Try to work around corrupted OpenStack images in a different way
I continue to find that the OpenStack images deployed by Packer are
often corrupt, in that files added during provisioning exist but are
truncated to 0 bytes.
I found <https://github.com/mitchellh/packer/issues/1462> which suggests
the problem might be that Packer takes a snapshot without shutting down
or even running 'sync' in the image. Adding lots of 'sync' calls at the
end of provisioning does seem to have helped, so far!
-rw-r--r-- | baserock_openid_provider/packer_template.json | 10 | ||||
-rw-r--r-- | frontend/packer_template.json | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/baserock_openid_provider/packer_template.json b/baserock_openid_provider/packer_template.json index 046042bc..69288a92 100644 --- a/baserock_openid_provider/packer_template.json +++ b/baserock_openid_provider/packer_template.json @@ -21,11 +21,6 @@ "provisioners": [ { "type": "shell", - "inline": [ "sleep 10" ], - "only": ["production"] - }, - { - "type": "shell", "inline": [ "sudo chown fedora:fedora /srv" ], "only": ["production"] }, @@ -61,6 +56,11 @@ "sudo systemctl start cherokee" ], "only": ["production"] + }, + { + "type": "shell", + "inline": [ "sync; sync; sleep 10; sync" ], + "only": ["production"] } ], "post-processors": [ diff --git a/frontend/packer_template.json b/frontend/packer_template.json index 83b9fd93..ca5b4cef 100644 --- a/frontend/packer_template.json +++ b/frontend/packer_template.json @@ -20,11 +20,6 @@ ], "provisioners": [ { - "type": "shell", - "inline": [ "sleep 10" ], - "only": ["production"] - }, - { "type": "file", "source": "frontend/haproxy.cfg", "destination": "/var/tmp/haproxy.cfg" @@ -44,6 +39,11 @@ "sudo systemctl start haproxy.service" ], "only": ["production"] + }, + { + "type": "shell", + "inline": [ "sync; sync; sleep 10; sync" ], + "only": ["production"] } ], "post-processors": [ |