Преглед на файлове

mongodb: Set repo version by variable

Philipp Fromme преди 1 година
родител
ревизия
efcc12bfd4
променени са 2 файла, в които са добавени 11 реда и са изтрити 4 реда
  1. 2 1
      graylog/init.sls
  2. 9 3
      mongodb/init.sls

+ 2 - 1
graylog/init.sls

@@ -3,9 +3,10 @@
 #
 
 {% set graylog_config = salt['pillar.get']('logging:graylog') %}
+{% set mongodb_version = '4.2' %}
+{% include '../mongodb/init.sls' %}
 
 include:
-  - mongodb
   - elasticsearch
 
 graylog-repo:

+ 9 - 3
mongodb/init.sls

@@ -2,12 +2,18 @@
 # mongodb
 #
 
-mongodb-repo-4.2:
+mongodb-repo:
   pkgrepo.managed:
     - humanname: MongoDB Repo
+    - file: /etc/apt/sources.list.d/mongodb-org.list
+    - key_url: https://www.mongodb.org/static/pgp/server-{{ mongodb_version }}.asc
+    {% if mongodb_version == '4.2' %}
     - name: deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main
-    - file: /etc/apt/sources.list.d/mongodb-org-4.2.list
-    - key_url: https://www.mongodb.org/static/pgp/server-4.2.asc
+    {% elif mongodb_version == '4.4' %}
+    - name: deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main
+    {% elif mongodb_version == '5.0' %}
+    - name: deb http://repo.mongodb.org/apt/debian {{ grains.oscodename }}/mongodb-org/5.0 main
+    {% endif %}
 
 mongodb:
   pkg.installed: