From b1450140f1850fa857b9ac74eac8827842f78a15 Mon Sep 17 00:00:00 2001 From: Chi Lo Date: Tue, 2 Jun 2020 17:13:58 -0700 Subject: [PATCH] Retreive Location information from new environment variables Change-Id: Ifb075af88489ef85e45de001a495723f5443ad94 --- ranger-agent/templates/bin/_add-region.py.tpl | 10 ++++++++++ ranger-agent/templates/job-add-region.yaml | 12 ++++++++++++ ranger-agent/values.yaml | 4 ++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ranger-agent/templates/bin/_add-region.py.tpl b/ranger-agent/templates/bin/_add-region.py.tpl index 4abb46fe..eadae485 100644 --- a/ranger-agent/templates/bin/_add-region.py.tpl +++ b/ranger-agent/templates/bin/_add-region.py.tpl @@ -81,6 +81,16 @@ def build_payload(): payload['name'] = os.environ['OS_REGION_NAME'] payload['vlcpName'] = os.environ['OS_REGION_NAME'] + payload['address'] = { + "street": os.environ['LOCATION_ADDRESS'], + "city": os.environ['LOCATION_NAME'], + "state": os.environ['LOCATION_STATE'], + "zip": os.environ['LOCATION_ZIP'], + "country": os.environ['LOCATION_COUNTRY']} + + payload['CLLI'] = os.environ['LOCATION_ID'] + payload['locationType'] = os.environ['LOCATION_ID'] + description = "Automatic creation of Region %s" % os.environ['OS_REGION_NAME'] payload['description'] = description diff --git a/ranger-agent/templates/job-add-region.yaml b/ranger-agent/templates/job-add-region.yaml index 279a8192..71f75509 100755 --- a/ranger-agent/templates/job-add-region.yaml +++ b/ranger-agent/templates/job-add-region.yaml @@ -50,6 +50,18 @@ spec: env: - name: PARAMETERS value: {{ .Values.conf.region.parameters | quote }} + - name: LOCATION_ADDRESS + value: {{ default "TBD" .Values.conf.region.location.address | quote }} + - name: LOCATION_NAME + value: {{ default "TBD" .Values.conf.region.location.name | quote }} + - name: LOCATION_STATE + value: {{ default "TBD" .Values.conf.region.location.state | quote }} + - name: LOCATION_ZIP + value: {{ default "TBD" .Values.conf.region.location.zip | quote }} + - name: LOCATION_COUNTRY + value: {{ default "TBD" .Values.conf.region.location.country | quote }} + - name: LOCATION_ID + value: {{ default "TBD" .Values.conf.region.location.location_physical_location_id | quote }} - name: DASHBOARD_ENDPOINT value: {{ tuple "dashboard" "public" "web" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | trimSuffix "/" }} - name: IDENTITY_ENDPOINT diff --git a/ranger-agent/values.yaml b/ranger-agent/values.yaml index dec87c75..98022814 100644 --- a/ranger-agent/values.yaml +++ b/ranger-agent/values.yaml @@ -595,8 +595,8 @@ conf: expected_end_status_key: Success region: parameters: |- - { "rangerAgentVersion": "1.0", - "OSVersion": "Ubuntu18.04" + { "rangerAgentVersion": "2.0", + "OSVersion": "Stein" } rms_listener_endpoint: http://localhost:7003/v2/orm/regions