From e7699d4abe5bbbf605b5e7278bef0e76e8ebe05f Mon Sep 17 00:00:00 2001 From: Balint Varga Date: Wed, 17 Jul 2019 09:35:00 +0200 Subject: [PATCH] Unused variable removed swift_registry_pass was an unused variable Signed-off-by: Balint Varga Change-Id: I5163b181560e8d827af8a4b216bfe385a1837596 --- SPECS/registry.spec | 2 +- SPECS/swift.spec | 2 +- .../roles/registry/templates/main/dockerreg.yml | 4 +-- .../roles/registry/templates/update/dockerreg.yml | 4 +-- ansible/roles/swift/tasks/main.yml | 2 -- ansible/roles/swift/tasks/password_gen.yml | 27 ----------------- ansible/roles/swift/tasks/password_handler.yml | 35 ---------------------- .../roles/swift/templates/main/proxy-server.conf | 1 - .../roles/swift/templates/update/proxy-server.conf | 1 - .../roles/swift/templates/update/registry_envfile | 19 ------------ 10 files changed, 6 insertions(+), 91 deletions(-) delete mode 100644 ansible/roles/swift/tasks/password_gen.yml delete mode 100644 ansible/roles/swift/tasks/password_handler.yml delete mode 100644 ansible/roles/swift/templates/update/registry_envfile diff --git a/SPECS/registry.spec b/SPECS/registry.spec index b8247a7..080608b 100644 --- a/SPECS/registry.spec +++ b/SPECS/registry.spec @@ -15,7 +15,7 @@ %define COMPONENT registry %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 2.7.1 -%define RPM_MINOR_VERSION 2 +%define RPM_MINOR_VERSION 3 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION} Name: %{RPM_NAME} Version: %{RPM_MAJOR_VERSION} diff --git a/SPECS/swift.spec b/SPECS/swift.spec index 061f8ab..3f0edcf 100644 --- a/SPECS/swift.spec +++ b/SPECS/swift.spec @@ -15,7 +15,7 @@ %define COMPONENT swift %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 2.21.0 -%define RPM_MINOR_VERSION 4 +%define RPM_MINOR_VERSION 5 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION} Name: %{RPM_NAME} Version: %{RPM_MAJOR_VERSION} diff --git a/ansible/roles/registry/templates/main/dockerreg.yml b/ansible/roles/registry/templates/main/dockerreg.yml index bd7e49b..7baab71 100644 --- a/ansible/roles/registry/templates/main/dockerreg.yml +++ b/ansible/roles/registry/templates/main/dockerreg.yml @@ -21,8 +21,8 @@ storage: delete: enabled: true swift: - username: admin:registry - password: {{ swift_registry_pass }} + username: admin:admin + password: {{ swift_admin_pass }} authurl: {{ caas.swift }}/auth/v1.0 container: dockerregistry http: diff --git a/ansible/roles/registry/templates/update/dockerreg.yml b/ansible/roles/registry/templates/update/dockerreg.yml index 047658d..e81efea 100644 --- a/ansible/roles/registry/templates/update/dockerreg.yml +++ b/ansible/roles/registry/templates/update/dockerreg.yml @@ -21,8 +21,8 @@ storage: delete: enabled: true swift: - username: admin:registry - password: {{ swift_registry_pass }} + username: admin:admin + password: {{ swift_admin_pass }} authurl: {{ caas.swift_update }}/auth/v1.0 container: dockerregistry http: diff --git a/ansible/roles/swift/tasks/main.yml b/ansible/roles/swift/tasks/main.yml index e139aee..e1d5a37 100644 --- a/ansible/roles/swift/tasks/main.yml +++ b/ansible/roles/swift/tasks/main.yml @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- import_tasks: password_handler.yml - - name: create directories file: path: "{{ item }}" diff --git a/ansible/roles/swift/tasks/password_gen.yml b/ansible/roles/swift/tasks/password_gen.yml deleted file mode 100644 index eaee056..0000000 --- a/ansible/roles/swift/tasks/password_gen.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -# 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. - -- shell: openssl rand -hex 10 | /usr/bin/openssl enc -aes-256-cbc -a -pass pass:{{ name }} - register: password - -- name: insert passwords into etcd - command: '/usr/bin/curl -X PUT - https://{{ ansible_host }}:{{ caas.etcd_api_port }}/v2/keys/swift/{{ item }}?prevExist=false - --cacert /etc/etcd/ssl/ca.pem - --cert /etc/etcd/ssl/etcd{{ nodeindex }}.pem - --key /etc/etcd/ssl/etcd{{ nodeindex }}-key.pem - --data-urlencode value="{{ password.stdout }}"' - become_user: "root" - diff --git a/ansible/roles/swift/tasks/password_handler.yml b/ansible/roles/swift/tasks/password_handler.yml deleted file mode 100644 index 576ade5..0000000 --- a/ansible/roles/swift/tasks/password_handler.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# 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. - -- include_tasks: password_gen.yml - with_items: - - "registry" - -- name: get registry password - command: '/usr/bin/curl - https://{{ ansible_host }}:{{ caas.etcd_api_port }}/v2/keys/swift/registry - --cacert /etc/etcd/ssl/ca.pem - --cert /etc/etcd/ssl/etcd{{ nodeindex }}.pem - --key /etc/etcd/ssl/etcd{{ nodeindex }}-key.pem' - register: registry_pass - become_user: "root" - -- name: decode registry pass - shell: echo {{ (registry_pass.stdout|from_json).node.value }} | /usr/bin/openssl enc -d -aes-256-cbc -a -pass pass:{{ name }} - register: registry_pass - -- name: set registry pass - set_fact: - swift_registry_pass: "{{ registry_pass.stdout }}" diff --git a/ansible/roles/swift/templates/main/proxy-server.conf b/ansible/roles/swift/templates/main/proxy-server.conf index 1954c21..b4789af 100644 --- a/ansible/roles/swift/templates/main/proxy-server.conf +++ b/ansible/roles/swift/templates/main/proxy-server.conf @@ -49,4 +49,3 @@ storage_url_scheme = https use = egg:swift#tempauth # user__ = user_admin_admin = {{ caas.swift_credential.password }} .admin .reseller_admin -user_admin_registry = {{ swift_registry_pass }} .admin diff --git a/ansible/roles/swift/templates/update/proxy-server.conf b/ansible/roles/swift/templates/update/proxy-server.conf index 4855a15..fac93cc 100644 --- a/ansible/roles/swift/templates/update/proxy-server.conf +++ b/ansible/roles/swift/templates/update/proxy-server.conf @@ -44,4 +44,3 @@ storage_url_scheme = https use = egg:swift#tempauth # user__ = user_admin_admin = {{ caas.swift_credential.password }} .admin .reseller_admin -user_admin_registry = {{ swift_registry_pass }} .admin diff --git a/ansible/roles/swift/templates/update/registry_envfile b/ansible/roles/swift/templates/update/registry_envfile deleted file mode 100644 index 1ec550f..0000000 --- a/ansible/roles/swift/templates/update/registry_envfile +++ /dev/null @@ -1,19 +0,0 @@ -{# -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. -#} -export SWIFT_USER=registry -export SWIFT_TENANT=admin -export SWIFT_PASS={{ swift_registry_pass }} - -- 2.16.6