[debian] allow the configuration of debian pkg repos in pillars (closes #5434795)
authorKatia Saurfelt <katia.saurfelt@logilab.fr>
Fri, 05 Jun 2015 11:25:26 +0200
changeset 35 f1627c0a65fd
parent 34 cda97f743aee
child 36 581a383990fa
[debian] allow the configuration of debian pkg repos in pillars (closes #5434795)
cubicweb/init.sls
pillar.example
--- a/cubicweb/init.sls	Thu Jun 04 16:41:02 2015 +0200
+++ b/cubicweb/init.sls	Fri Jun 05 11:25:26 2015 +0200
@@ -1,7 +1,13 @@
 include:
+  {% if pillar.get('debian_pkgrepos') %}
+  {% for info in pillar['debian_pkgrepos'].itervalues() %}
+  - {{ info['sls'] }}
+  {% endfor %}
+  {% else %}
   - logilab.public
   - logilab.backports
   - cubicweb.dependencies
+  {% endif %}
 
 cw-logilab-deps:
   pkg.installed:
@@ -12,8 +18,14 @@
       - python-logilab-database
       - python-logilab-mtconverter
     - require:
+    {% if pillar.get('debian_pkgrepos') %}
+    {% for  pkgrepo in pillar['debian_pkgrepos'].iterkeys() %}
+      - pkgrepo: {{ pkgrepo }}
+    {% endfor %}
+    {% else %}
       - pkgrepo: logilab-public-production
       - pkgrepo: logilab-public-acceptance
+    {% endif %}
     - fromrepo: {{pillar.get('cubicweb_repo', 'production')}}
 
 cw-core:
@@ -55,7 +67,7 @@
     - pkgs:
     {% if pillar.get('cubicweb_version') %}
       - cubicweb-web : {{ pillar.get('cubicweb_version') }}
-      - cubicweb-twisted : {{ pillar.get('cubicweb_version') }} 
+      - cubicweb-twisted : {{ pillar.get('cubicweb_version') }}
     {% else %}
       - cubicweb-web
       - cubicweb-twisted
--- a/pillar.example	Thu Jun 04 16:41:02 2015 +0200
+++ b/pillar.example	Fri Jun 05 11:25:26 2015 +0200
@@ -24,6 +24,10 @@
 ## you can add extra repository sources
 #extra_sources:
 #  - deb https://user:password@domain.com/path/dists/ wheezy/
+## you can specify your own repository sources  instead of logilab default
+debian_pkgrepos:
+  pkgrepository_name: # cf. logilab-public-production
+    sls: pkgrepository # cf. logilab.public
 
 ## Declare your cubicweb applications there
 cubicweb_apps: