Rename control into config
Change-Id: I13ef171b9294d607e590db6b8d96019477e72c71
diff --git a/devops_portal/files/config.json b/devops_portal/files/config.json
index bb07fae..cf0b5cb 100644
--- a/devops_portal/files/config.json
+++ b/devops_portal/files/config.json
@@ -1,4 +1,4 @@
-{%- from "devops_portal/map.jinja" import control with context -%}
+{%- from "devops_portal/map.jinja" import config with context -%}
{%- from "devops_portal/map.jinja" import services with context -%}
{%- macro credentials(parameters) -%}
{%- set keys = ['token', 'username', 'password'] -%}
@@ -11,7 +11,7 @@
{%- endmacro %}
{
"services": {
- {%- for service_name, service in salt['devops_utils.iter_items'](services, control.services) %}
+ {%- for service_name, service in salt['devops_utils.iter_items'](services, config.services) %}
{%- if not loop.first %},{% endif -%}
{%- if service|length() > 0 and service.enabled %}
"{{ service_name }}": {
diff --git a/devops_portal/files/kubernetes/devops_portal-cm.yaml b/devops_portal/files/kubernetes/devops_portal-cm.yaml
index 589b434..fcfaa48 100644
--- a/devops_portal/files/kubernetes/devops_portal-cm.yaml
+++ b/devops_portal/files/kubernetes/devops_portal-cm.yaml
@@ -1,3 +1,4 @@
+{%- from "devops_portal/map.jinja" import config with context %}
{%- macro include_by_filename(filename) -%}
{%- include filename -%}
{%- endmacro -%}
@@ -7,6 +8,6 @@
name: devops-portal
data:
config.json: |
-{{ include_by_filename('/srv/oss/devops_portal/config/config.json')|indent(width=4, indentfirst=True) }}
+{{ include_by_filename(config.base_dir + '/config/config.json')|indent(width=4, indentfirst=True) }}
nginx.conf: |
-{{ include_by_filename('/srv/oss/devops_portal/nginx/nginx.conf')|indent(width=4, indentfirst=True) }}
+{{ include_by_filename(config.base_dir + '/nginx/nginx.conf')|indent(width=4, indentfirst=True) }}
diff --git a/devops_portal/files/kubernetes/devops_portal-deploy.yaml b/devops_portal/files/kubernetes/devops_portal-deploy.yaml
index c6c1c1e..f5d13fe 100644
--- a/devops_portal/files/kubernetes/devops_portal-deploy.yaml
+++ b/devops_portal/files/kubernetes/devops_portal-deploy.yaml
@@ -1,5 +1,5 @@
-{%- from "devops_portal/map.jinja" import control with context %}
-{%- set container = control.container %}
+{%- from "devops_portal/map.jinja" import config with context %}
+{%- set container = config.container %}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
@@ -20,7 +20,7 @@
- /etc/nginx/config/nginx.conf
env:
- name: CONFIGMAP_HASH
- value: {{ salt['hashutil.digest_file']('/srv/oss/devops_portal/kubernetes/devops_portal-cm.yaml') }}
+ value: {{ salt['hashutil.digest_file'](config.base_dir + '/kubernetes/devops_portal-cm.yaml') }}
volumeMounts:
- name: nginx-conf
mountPath: /etc/nginx/config
diff --git a/devops_portal/files/kubernetes/devops_portal-svc.yaml b/devops_portal/files/kubernetes/devops_portal-svc.yaml
index cde5657..ea102f8 100644
--- a/devops_portal/files/kubernetes/devops_portal-svc.yaml
+++ b/devops_portal/files/kubernetes/devops_portal-svc.yaml
@@ -1,5 +1,5 @@
-{%- from "devops_portal/map.jinja" import control with context %}
-{%- set container = control.container %}
+{%- from "devops_portal/map.jinja" import config with context %}
+{%- set container = config.container %}
apiVersion: v1
kind: Service
metadata:
diff --git a/devops_portal/files/nginx.conf b/devops_portal/files/nginx.conf
index bb7878a..ca27f0d 100644
--- a/devops_portal/files/nginx.conf
+++ b/devops_portal/files/nginx.conf
@@ -1,4 +1,4 @@
-{%- from "devops_portal/map.jinja" import control with context -%}
+{%- from "devops_portal/map.jinja" import config with context -%}
{%- from "devops_portal/map.jinja" import services with context -%}
daemon off;
@@ -42,8 +42,8 @@
}
{%- for service_name in services %}
-{%- if control.services[service_name] is defined %}
-{%- set service = control.services[service_name] %}
+{%- if config.services[service_name] is defined %}
+{%- set service = config.services[service_name] %}
{%- if service.enabled|default(False) and service.configure_proxy|default(False) %}
location /api/{{ service_name }} {