corrected bugs:
authorPaul Tonelli <paul.tonelli@logilab.fr>
Thu, 21 Mar 2013 16:55:54 +0100
changeset 90 e3d6302bcff4
parent 89 d6f5473f3dc1
child 91 b7d005a8ef48
corrected bugs: - if there is a bug in the templating (grain absent) everything is cancelled, and the previous version could not work - present -> grains.present (error in state name)
update.sls
--- a/update.sls	Thu Mar 21 17:48:07 2013 +0100
+++ b/update.sls	Thu Mar 21 16:55:54 2013 +0100
@@ -8,21 +8,19 @@
       - rsync
       - glance
 
-
-
-{% if 'ami.hg_address' not in grains %}
+{% if 'ami.hg_address_server' not in grains %}
 ami.hg_address_server:
-    present:
-        - value: {{ salt['state.single']('grains.present', 'ami.hg_address_server', value='http://hg.logilab.org/users/ptonelli/ami_creator/server') }}
+    grains.present:
+        - value: http://hg.logilab.org/users/ptonelli/ami_creator/server
 {% endif %}
 
-{% if 'ami.hg_address' not in grains %}
+{% if 'ami.hg_address_variation' not in grains %}
 ami.hg_address_variation:
-    present:
-        - value: {{ salt['state.single']('grains.present', 'ami.hg_address_variation', value='http://hg.logilab.org/users/ptonelli/ami_creator/variation') }}
+    grains.present:
+        - value: http://hg.logilab.org/users/ptonelli/ami_creator/variation
 {% endif %}
 
-
+{% if 'ami.hg_address_server' in grains %}
 hg_code:
     hg.latest:
         - name: {{ grains['ami.hg_address_server'] }}
@@ -32,3 +30,4 @@
         - target: /etc/salt/srv
         - require:
             - pkg: my_pkgs
+{% endif %}