use dictionnaries for cube listing
authorDavid Douard <david.douard@logilab.fr>
Mon, 02 Jun 2014 16:53:25 +0200
changeset 4 5e5876d342d0
parent 3 71cd0777119a
child 5 1e0786de308b
use dictionnaries for cube listing this allow to have cubes which debian package has a different name
cubicweb/instances.sls
pillar.example
--- a/cubicweb/instances.sls	Mon Jun 02 15:42:38 2014 +0200
+++ b/cubicweb/instances.sls	Mon Jun 02 16:53:25 2014 +0200
@@ -10,7 +10,7 @@
     - port: {{config.cwapp.port}}
     - admin/login: {{config.cwapp.adminuser}}
     - admin/password: {{config.cwapp.adminpass}}
-    - cubes: {{config.cwapp.cubes}}
+    - cubes: {{config.cwapp.cubes.keys()}}
     - db-host: {{config.database.host}}
     - db-port: {{config.database.port}}
     - db-name: {{config.database.name}}
@@ -20,8 +20,8 @@
       - pkg: cw-{{vhostname}}-{{name}}
   pkg.installed:
     - pkgs:
-        {% for cube in config.cwapp.cubes -%}
-        - cubicweb-{{cube}} {% endfor %}
+        {% for pkg in config.cwapp.cubes.values() -%}
+        - {{pkg}} {% endfor %}
     - require:
       - pkg: cw-web
 
--- a/pillar.example	Mon Jun 02 15:42:38 2014 +0200
+++ b/pillar.example	Mon Jun 02 16:53:25 2014 +0200
@@ -1,26 +1,30 @@
 cubicweb_apps:
   www.cubicweb.org:
-    - demo1:
-        database:
-          name: cw_blog
-          user: logidemo
-	  password: logidemo
-          cluster: 9.1/main
-        cwapp:
-          basepath: /demo/blog
-          port: 9090
-          adminuser: admin
-          adminpass: admin
-          cubes:
-            - blog
-    - demo2:
-        database:
-          name: cw_demo2
-          user: logidemo
-        cwapp:
-          basepath: /demo/demo2
-          port: 9091
-          adminuser: admin
-          adminpass: admin
-          cubes:
-            - blog
+    demo1:
+      database:
+        name: cw_blog
+        user: logidemo
+        password: logidemo
+        host: db1
+        port: 5432
+    cwapp:
+        basepath: /demo/blog
+        port: 9090
+        adminuser: admin
+        adminpass: admin
+        cubes:
+          blog: cubicweb-blog
+    demo2:
+      database:
+        name: cw_demo2
+        user: logidemo
+        password: logidemo
+        host: db1
+        port: 5432
+      cwapp:
+        basepath: /demo/demo2
+        port: 9091
+        adminuser: admin
+        adminpass: admin
+        cubes:
+          blog: cubicweb-blog