From: bborbely Date: Tue, 2 Jul 2019 14:16:20 +0000 (+0200) Subject: Move swift authentication data to cm X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=b1a41227609aa5ce459494611d424c85d08448eb;p=ta%2Fcaas-install.git Move swift authentication data to cm Change-Id: Ic8c758c8f2a85c3b6a20c65fd7de94f998c2f899 Signed-off-by: bborbely --- diff --git a/SPECS/utils.spec b/SPECS/utils.spec index 1c3efac..b65f243 100644 --- a/SPECS/utils.spec +++ b/SPECS/utils.spec @@ -49,11 +49,9 @@ install -m 0700 utils/deploy/merge_image.sh %{buildroot}/%{_caas_libexec_path}/ mkdir -p %{buildroot}/etc/systemd/system/ # --------------------------- COMMON mkdir -p %{buildroot}/etc/profile.d/ -install -m 0644 utils/common/aliases.sh %{buildroot}/etc/profile.d/ %files %{_caas_libexec_path}/merge_image.sh -/etc/profile.d/aliases.sh /etc/logrotate.d/kubelet-plugins %exclude %{_caas_libexec_path}/*pyc %exclude %{_caas_libexec_path}/*pyo @@ -81,8 +79,6 @@ if [ $1 == 0 ]; then /usr/bin/systemctl daemon-reload # --------------------------- DEPLOY # --------------------------- COMMON - rm -rf /etc/profile.d/aliases.sh - fi diff --git a/ansible/roles/pre_config_all/tasks/main.yml b/ansible/roles/pre_config_all/tasks/main.yml index f074452..ce07505 100644 --- a/ansible/roles/pre_config_all/tasks/main.yml +++ b/ansible/roles/pre_config_all/tasks/main.yml @@ -145,14 +145,3 @@ shell: "kubectl completion bash > /etc/bash_completion.d/kubectl-bash" become: true become_user: "root" - -- name: set envinment variables - lineinfile: - dest: /etc/environment - state: present - line: "{{ item }}" - regexp: "{{ item }}" - become: true - become_user: "root" - with_items: - - "SWIFT_URL={{ caas.swift }}" diff --git a/utils/common/aliases.sh b/utils/common/aliases.sh deleted file mode 100644 index 18587bb..0000000 --- a/utils/common/aliases.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Copyright 2019 Nokia -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Swift -function swiftauth { source /etc/swift/usr/admin/env_file; export SWIFT_AUTH_KEY=`curl --cacert /etc/swift/main/tls-proxy/ca.pem -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;}'`; } -function swiftget { curl --cacert /etc/swift/main/tls-proxy/ca.pem -XGET -H"X-Auth-Token: ${SWIFT_AUTH_KEY}" "${SWIFT_URL}/v1.0/AUTH_admin${1}"; } -function swiftput { curl --cacert /etc/swift/main/tls-proxy/ca.pem -XPUT -H"X-Auth-Token: ${SWIFT_AUTH_KEY}" -T ${1} "${SWIFT_URL}/v1.0/AUTH_admin${2}"; }