remove download of image if already available
authorPaul Tonelli <paul.tonelli@logilab.fr>
Tue, 21 May 2013 17:54:31 +0200
changeset 135 9e786945c1a5
parent 134 1b8d9f500d7a
child 136 a3455c6ea870
remove download of image if already available
ami_pre/init.sls
--- a/ami_pre/init.sls	Mon May 13 11:12:53 2013 +0200
+++ b/ami_pre/init.sls	Tue May 21 17:54:31 2013 +0200
@@ -1,5 +1,6 @@
 ### unarchived files ###
 
+{% if not salt['file.file_exists']('/mnt/output/variation.img') %}
 variation_extracted:
     archive.extracted:
         - name: /mnt/output/
@@ -13,6 +14,7 @@
         - archive_format: tar
         - tar_options: z
         - rename_regexp: s/.*\.img/variation.img/
+{% endif %}
 
 
 ### Resize the partition ###
@@ -20,8 +22,10 @@
     tmp_state.resized:
         - name: /mnt/output/variation.img
         - size: 3G
+{% if not salt['file.file_exists']('/mnt/output/variation.img') %}
         - require:
             - archive.extracted: variation_extracted
+{% endif %}
 
 ###  Directories ###
 /mnt/variation: