From c6a8376d066ec907dbd9cb7aa65b54219f137c9c Mon Sep 17 00:00:00 2001 From: Krisztian Lengyel Date: Fri, 10 May 2019 16:17:50 -0400 Subject: [PATCH] Make CaaS DNS domains configurable Change-Id: Ie3b17c3da078adba8c3025663f6ca5e29c52406d --- ansible/roles/swift/templates/main/swift_main.yml | 2 ++ ansible/roles/swift/templates/update/swift_update.yml | 2 ++ docker-build/swift/healthchecker.sh | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ansible/roles/swift/templates/main/swift_main.yml b/ansible/roles/swift/templates/main/swift_main.yml index bcbf9e8..1b752df 100644 --- a/ansible/roles/swift/templates/main/swift_main.yml +++ b/ansible/roles/swift/templates/main/swift_main.yml @@ -66,6 +66,8 @@ spec: - name: "SWIFT_OAM{{loop.index}}_IP" value: "{{ hostvars[host]['networking']['infra_internal']['ip'] }}" {% endfor %} + - name: "SWIFT_URL" + value: "{{ caas.swift }}" volumeMounts: - name: config mountPath: /etc/swift/ diff --git a/ansible/roles/swift/templates/update/swift_update.yml b/ansible/roles/swift/templates/update/swift_update.yml index 8f6f940..38435aa 100644 --- a/ansible/roles/swift/templates/update/swift_update.yml +++ b/ansible/roles/swift/templates/update/swift_update.yml @@ -58,6 +58,8 @@ spec: value: "1" - name: "SWIFT_OAM1_IP" value: "{{ hostvars[groups.caas_master[0]]['networking']['infra_internal']['ip'] }}" + - name: "SWIFT_URL" + value: "{{ caas.swift }}" volumeMounts: - name: config mountPath: /etc/swift/ diff --git a/docker-build/swift/healthchecker.sh b/docker-build/swift/healthchecker.sh index db7df24..40261a2 100755 --- a/docker-build/swift/healthchecker.sh +++ b/docker-build/swift/healthchecker.sh @@ -13,6 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -SWIFT_AUTH_KEY=$(curl --cacert /etc/swift/tls-proxy/ca.pem -Ss -XGET -i -H"X-Auth-User:${SWIFT_TENANT}:${SWIFT_USER}" -H"X-Auth-Key:${SWIFT_PASS}" https://swift.kube-system.svc.nokia.net:8084/auth/v1.0 | grep X-Auth-Token: | awk "{ print \$2 }") +if [ -z "${SWIFT_URL}" ]; then + echo "Error: missing environment variable: SWIFT_URL" + exit 1 +fi -curl --fail --cacert /etc/swift/tls-proxy/ca.pem -Ss -XGET -H"X-Auth-Token: ${SWIFT_AUTH_KEY}" https://swift.kube-system.svc.nokia.net:8084/v1.0/AUTH_admin +SWIFT_AUTH_KEY=$(curl --cacert /etc/swift/tls-proxy/ca.pem -Ss -XGET -i -H"X-Auth-User:${SWIFT_TENANT}:${SWIFT_USER}" -H"X-Auth-Key:${SWIFT_PASS}" "${SWIFT_URL}/auth/v1.0" | grep X-Auth-Token: | awk "{ print \$2 }") + +curl --fail --cacert /etc/swift/tls-proxy/ca.pem -Ss -XGET -H"X-Auth-Token: ${SWIFT_AUTH_KEY}" "${SWIFT_URL}/v1.0/AUTH_admin" -- 2.16.6