use a curl macro to get the md5sum of a downloaded image instead of the name containing the md5 (the previous wasn't working)
authorPaul Tonelli <paul.tonelli@logilab.fr>
Wed, 27 Mar 2013 10:21:20 +0100
changeset 108 05f01e1d3341
parent 107 bbbd2e0ec71b
child 109 3b7c74c614ca
use a curl macro to get the md5sum of a downloaded image instead of the name containing the md5 (the previous wasn't working)
ami_pre/init.sls
--- a/ami_pre/init.sls	Tue Mar 26 14:54:47 2013 +0100
+++ b/ami_pre/init.sls	Wed Mar 27 10:21:20 2013 +0100
@@ -8,7 +8,7 @@
         - source_hash: {{ grains['ami.source_hash'] }}
 {% else %}
         - source: http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64.tar.gz
-        - source_hash: md5=http://cloud-images.ubuntu.com/precise/current/MD5SUMS 
+        - source_hash: md5={{ salt['cmd.run']("curl -s http://cloud-images.ubuntu.com/precise/current/MD5SUMS |grep precise-server-cloudimg-amd64.tar.gz |awk '{print $1}'") }}
 {% endif %}
         - archive_format: tar
         - tar_options: z