rely on a user defined source for the .img file used by ami_creator instead of a tarball
authorPaul Tonelli <paul.tonelli@logilab.fr>
Fri, 22 Mar 2013 14:14:30 +0100
changeset 93 c5be902f46b7
parent 92 46707aed3c76
child 94 4a2b15de9ec9
rely on a user defined source for the .img file used by ami_creator instead of a tarball this source must be an available address of an archive file (for now tar.gz) and must contain a single .ami file which will be used. The ami file must be a file containing a single partition
ami_pre/init.sls
readme.rst
--- a/ami_pre/init.sls	Fri Mar 22 11:38:47 2013 +0100
+++ b/ami_pre/init.sls	Fri Mar 22 14:14:30 2013 +0100
@@ -3,11 +3,17 @@
 variation_extracted:
     archive.extracted:
         - name: /mnt/
-        - source: salt://variation_{{ grains['ami.type'] }}.tar.gz
+{% if 'ami.source_adress' in grains %}
+        - source: {{ grains['ami.source_adress'] }}
+{% else %}
+        - source: http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64.tar.gz
+{% 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:
--- a/readme.rst	Fri Mar 22 11:38:47 2013 +0100
+++ b/readme.rst	Fri Mar 22 14:14:30 2013 +0100
@@ -36,6 +36,7 @@
 ami.hg_rev_variation: 249:9ed741a55f17
 ami.hg_address_variation: http://hg.logilab.org/users/ptonelli/ami_creator/variation
 ami.name: my_variation 
+ami.source_adress: http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64.tar.gz
 ami.type: debian #or ubuntu
 
 ### optionnal ###