created additionnal state for preparatory state (update.sls) and updated top.sls salt file to call it instead of ami_creator.sls (ami_creator.sls will actually prepare the machine in next commit)
authorPaul Tonelli <paul.tonelli@logilab.fr>
Fri, 15 Mar 2013 10:17:58 +0100
changeset 83 09fdf067e0b7
parent 82 d1208c3e8b50
child 84 40a8790380af
created additionnal state for preparatory state (update.sls) and updated top.sls salt file to call it instead of ami_creator.sls (ami_creator.sls will actually prepare the machine in next commit)
top.sls
update.sls
--- a/top.sls	Thu Mar 14 19:54:31 2013 +0100
+++ b/top.sls	Fri Mar 15 10:17:58 2013 +0100
@@ -1,4 +1,5 @@
 # /srv/salt/top.sls
 base:
   '*':
-    - ami_creator
+    - update
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/update.sls	Fri Mar 15 10:17:58 2013 +0100
@@ -0,0 +1,25 @@
+my_pkgs:
+  pkg.installed:
+    - pkgs:
+      - salt-minion
+      - python
+      - mercurial
+      - tar
+      - rsync
+      - glance
+
+{% if 'ami.hg_address' not in grains %}
+ami.hg_address:
+    grains.present:
+        - value : http://hg.logilab.fr/users/ptonelli/srv_salt
+{% endif %}
+
+hg_code:
+    hg.latest:
+        - name: {{ grains['ami.hg_address'] }}
+{% if 'ami.hg_rev' in grains %}
+        - rev: {{ grains['ami.hg_rev'] }}
+{% endif %}
+        - target: /etc/salt/srv
+        - require:
+            - pkg: my_pkgs