From 1e00a603b9e71c4b22a878f1e15088dd8cc587ec Mon Sep 17 00:00:00 2001 From: Daniel 'f0o' Preussker Date: Fri, 11 Apr 2025 16:06:58 +0000 Subject: [PATCH] Remove md5 checks of rings/builders Rsync step already ensures that all the files are correct, no point in doing it again. Change-Id: If2eec244312540122edae19ba1fae3e1d172a285 --- tasks/swift_rings.yml | 9 ---- tasks/swift_rings_check.yml | 41 ------------------- tasks/swift_rings_md5sum.yml | 24 ----------- tasks/swift_rings_post_distribution_check.yml | 16 -------- 4 files changed, 90 deletions(-) delete mode 100644 tasks/swift_rings_check.yml delete mode 100644 tasks/swift_rings_md5sum.yml diff --git a/tasks/swift_rings.yml b/tasks/swift_rings.yml index 740dad47..eca17756 100644 --- a/tasks/swift_rings.yml +++ b/tasks/swift_rings.yml @@ -13,21 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Including swift_rings_md5sum tasks - ansible.builtin.include_tasks: swift_rings_md5sum.yml - -- name: Including swift_rings_check tasks - ansible.builtin.include_tasks: swift_rings_check.yml - when: _swift_is_first_play_host - - name: Including swift_rings_build tasks ansible.builtin.include_tasks: swift_rings_build.yml when: _swift_is_first_play_host - name: Including swift_rings_distribute tasks ansible.builtin.include_tasks: swift_rings_distribute.yml -- name: Including swift_rings_md5sum tasks - ansible.builtin.include_tasks: swift_rings_md5sum.yml - name: Including swift_rings_post_distribution_check tasks ansible.builtin.include_tasks: swift_rings_post_distribution_check.yml diff --git a/tasks/swift_rings_check.yml b/tasks/swift_rings_check.yml deleted file mode 100644 index 92e8f87b..00000000 --- a/tasks/swift_rings_check.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -# Copyright 2014, Rackspace US, Inc. -# -# 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. - -- name: Get md5sum of local builder files - ansible.builtin.shell: | - cat /etc/swift/*.builder 2>/dev/null | md5sum | cut -d " " -f1 - changed_when: false - register: md5sum - -- name: Get empty md5sum - ansible.builtin.shell: | - echo -n | md5sum | cut -d " " -f1 - changed_when: false - register: empty_md5sum - -# Fail if the remote hosts builder files is not empty AND -# does not match the md5sum of the local host. -- name: Verify md5sum of builder files - ansible.builtin.fail: - msg: > - "The builder files on the remote host {{ item }}:{{ hostvars[item]['builder_md5sum'] }} - do not match {{ inventory_hostname }}:{{ md5sum.stdout }} - and are not empty on the remote host" - when: - - hostvars[item] is defined - - hostvars[item]['builder_md5sum'] is defined - - hostvars[item]['builder_md5sum'] != empty_md5sum.stdout - - hostvars[item]['builder_md5sum'] != md5sum.stdout - with_items: "{{ groups['swift_all'] + groups['swift_remote_all'] }}" diff --git a/tasks/swift_rings_md5sum.yml b/tasks/swift_rings_md5sum.yml deleted file mode 100644 index 34a9ced7..00000000 --- a/tasks/swift_rings_md5sum.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -# Copyright 2014, Rackspace US, Inc. -# -# 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. - -- name: Get md5sum of builder files - ansible.builtin.shell: | - cat /etc/swift/*.builder 2>/dev/null | md5sum | cut -d " " -f1 - changed_when: false - register: md5sum - -- name: Register a fact for the md5sum - ansible.builtin.set_fact: - builder_md5sum: "{{ md5sum.stdout }}" diff --git a/tasks/swift_rings_post_distribution_check.yml b/tasks/swift_rings_post_distribution_check.yml index 323718b6..ec9cd089 100644 --- a/tasks/swift_rings_post_distribution_check.yml +++ b/tasks/swift_rings_post_distribution_check.yml @@ -13,22 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Get md5sum of local builder files - ansible.builtin.shell: | - cat /etc/swift/*.builder 2>/dev/null | md5sum | cut -d " " -f1 - changed_when: false - register: md5sum - -# Fail if the remote hosts builder files don't match -# As this is post sync all should match and not be empty -- name: Verify md5sum of builder files - ansible.builtin.fail: - msg: > - "The builder files on the remote host {{ item }}:{{ hostvars[item]['builder_md5sum'] }} - do not match {{ inventory_hostname }}:{{ md5sum.stdout }}" - when: hostvars[item]['builder_md5sum'] != md5sum.stdout - with_items: "{{ groups['swift_all'] + groups['swift_remote_all'] }}" - - name: "Copy the swift_rings_check.py file" ansible.builtin.template: src: swift_rings_check.py.j2