add the source_hash which is necessary for getting http files in salt
authorPaul Tonelli <paul.tonelli@logilab.fr>
Tue, 26 Mar 2013 10:35:03 +0100
changeset 97 ae24ced33f8e
parent 96 077e05a2ce8e
child 98 032c0fd12892
add the source_hash which is necessary for getting http files in salt modify the path to output
ami_pre/init.sls
--- a/ami_pre/init.sls	Tue Mar 26 12:10:22 2013 +0100
+++ b/ami_pre/init.sls	Tue Mar 26 10:35:03 2013 +0100
@@ -2,22 +2,23 @@
 
 variation_extracted:
     archive.extracted:
-        - name: /mnt/
-{% if 'ami.source_adress' in grains %}
-        - source: {{ grains['ami.source_adress'] }}
+        - name: /mnt/output/
+{% if 'ami.source_address' in grains and 'ami.source_hash' in grains %}
+        - source: {{ grains['ami.source_address'] }}
+        - 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 
 {% endif %}
         - archive_format: tar
         - tar_options: z
         - rename_regexp: s/.*\.img/variation.img/
-        - if_missing: variation.img
 
 
 ### Resize the partition ###
 resize_variation:
     tmp_state.resized:
-        - name: /mnt/variation.img
+        - name: /mnt/output/variation.img
         - size: 3G
         - require:
             - archive.extracted: variation_extracted