diff --git a/tasks/swift_rings_build.yml b/tasks/swift_rings_build.yml index 7f3d9932..3e07848f 100644 --- a/tasks/swift_rings_build.yml +++ b/tasks/swift_rings_build.yml @@ -51,24 +51,10 @@ - swift-rings-contents - name: "build rings for account/container from contents files" - command: "/etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/{{ item }}.contents" - with_items: - - account - - container - when: swift_managed_regions is not defined - become: yes - become_user: "{{ swift_system_user_name }}" - args: - chdir: /etc/swift/ring_build_files/ - tags: - - swift-rings - - swift-rings-build - -- name: "build rings for account/container from contents files" - command: "/etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/{{ item[0] }}.contents -r {{ item[1] }}" + command: "/etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/{{ item[0] }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %}" with_nested: - [ 'account', 'container' ] - - swift_managed_regions | default([]) + - swift_managed_regions | default([None]) become: yes become_user: "{{ swift_system_user_name }}" args: @@ -78,23 +64,10 @@ - swift-rings-build - name: "build rings for storage policies from contents files" - command: "/etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/object-{{ item.policy.index }}.contents" - with_items: - - "{{ swift.storage_policies }}" - when: swift_managed_regions is not defined - become: yes - become_user: "{{ swift_system_user_name }}" - args: - chdir: /etc/swift/ring_build_files/ - tags: - - swift-rings - - swift-rings-build - -- name: "build rings for storage policies from contents files" - command: "/etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents -r {{ item[1] }}" + command: "/etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %}" with_nested: - "{{ swift.storage_policies }}" - - swift_managed_regions | default([]) + - swift_managed_regions | default([None]) become: yes become_user: "{{ swift_system_user_name }}" args: diff --git a/tasks/swift_rings_post_distribution_check.yml b/tasks/swift_rings_post_distribution_check.yml index 8aeeb96b..96304eea 100644 --- a/tasks/swift_rings_post_distribution_check.yml +++ b/tasks/swift_rings_post_distribution_check.yml @@ -44,24 +44,10 @@ - swift-rings-scripts - name: "Ensure contents file matches ring after ring sync for account/container" - command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/{{ item }}.contents" - with_items: - - account - - container - when: swift_managed_regions is not defined - become: yes - become_user: "{{ swift_system_user_name }}" - args: - chdir: /etc/swift/ring_build_files/ - tags: - - swift-rings - - swift-rings-check - -- name: "Ensure contents file matches ring after ring sync for account/container" - command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/{{ item[0] }}.contents -r {{ item[1] }}" + command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/{{ item[0] }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %}" with_nested: - [ 'account', 'container' ] - - swift_managed_regions | default([]) + - swift_managed_regions | default([None]) become: yes become_user: "{{ swift_system_user_name }}" args: @@ -71,23 +57,10 @@ - swift-rings-check - name: "Ensure contents file matches ring after ring sync for storage policies" - command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/object-{{ item.policy.index }}.contents" - with_items: - - "{{ swift.storage_policies }}" - when: swift_managed_regions is not defined - become: yes - become_user: "{{ swift_system_user_name }}" - args: - chdir: /etc/swift/ring_build_files/ - tags: - - swift-rings - - swift-rings-check - -- name: "Ensure contents file matches ring after ring sync for storage policies" - command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents -r {{ item[1] }}" + command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %}" with_nested: - "{{ swift.storage_policies }}" - - swift_managed_regions | default([]) + - swift_managed_regions | default([None]) become: yes become_user: "{{ swift_system_user_name }}" args: