changed image name to variation instead of variation_ubuntu / debian, only archive name changes
authorPaul Tonelli <paul.tonelli@logilab.fr>
Mon, 11 Mar 2013 14:28:35 +0100
changeset 54 7e33d0c7f399
parent 53 037d03aca265
child 55 a8fc89e61f2b
changed image name to variation instead of variation_ubuntu / debian, only archive name changes
ami_creator.sls
ami_creator_post.sls
ami_creator_pre.sls
--- a/ami_creator.sls	Mon Mar 11 14:27:03 2013 +0100
+++ b/ami_creator.sls	Mon Mar 11 14:28:35 2013 +0100
@@ -9,9 +9,19 @@
       - rsync
       - glance
 
+
+{% if  salt['file.find']('custom_hg_address') %}
+{% set hg_address = salt['file.find']('custom_hg_address') %}
+{% else %}
+{% set hg_address = 'http://hg.logilab.fr/users/ptonelli/srv_salt' %}
+{% endif %}
 hg_ami_creation:
     hg.latest:
-        - name: http://hg.logilab.fr/users/ptonelli/srv_salt
+        - name: {{ hg_address }}
+{% if  salt['file.find']('custom_hg_revision') %}
+{% set hg_rev = salt['file.find']('custom_hg_revision') %}
+        - rev: {{ hg_rev }}
+{% endif %}
         - target: /etc/salt/srv
         - require:
             - pkg: my_pkgs
--- a/ami_creator_post.sls	Mon Mar 11 14:27:03 2013 +0100
+++ b/ami_creator_post.sls	Mon Mar 11 14:28:35 2013 +0100
@@ -55,7 +55,7 @@
 ### Resize the partition to min ###
 resize_variation:
     tmp_state.resized:
-        - name: /mnt/variation_debian.img
+        - name: /mnt/variation.img
         - require:
             - tmp_state.unmounted: umount_chroot_slash
 
--- a/ami_creator_pre.sls	Mon Mar 11 14:27:03 2013 +0100
+++ b/ami_creator_pre.sls	Mon Mar 11 14:28:35 2013 +0100
@@ -5,17 +5,16 @@
         - source: salt://variation_debian.tar.gz
         - archive_format: tar
         - tar_options: z
-        - if_missing: variation_debian.img
+        - if_missing: variation.img
 
 ### Resize the partition ###
 resize_variation:
     tmp_state.resized:
-        - name: /mnt/variation_debian.img
+        - name: /mnt/variation.img
         - size: 3G
         - require:
             - archive.extracted: variation_extracted
 
-
 ###  Directories ###
 /mnt/variation:
     file.directory:
@@ -27,7 +26,7 @@
 ### Mounts ###
 mounted_variation:
     mount.mounted:
-        - device: /mnt/variation_debian.img
+        - device: /mnt/variation.img
         - name: /mnt/variation
         - fstype: ext4
         - mkmnt: False