diff --git a/tasks/swift_rings_build.yml b/tasks/swift_rings_build.yml index bfde6a1..f1b0de3 100644 --- a/tasks/swift_rings_build.yml +++ b/tasks/swift_rings_build.yml @@ -31,8 +31,8 @@ owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" with_items: - - { item: "{{ swift.account }}", port: "{{ swift_account_port }}", type: "account" } - - { item: "{{ swift.container }}", port: "{{ swift_container_port}}", type: "container" } + - { item: "{{ swift.account | default({}) }}", port: "{{ swift_account_port }}", type: "account" } + - { item: "{{ swift.container | default({}) }}", port: "{{ swift_container_port}}", type: "container" } tags: - swift-rings - swift-rings-contents @@ -68,8 +68,7 @@ command: "/usr/bin/python /etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/{{ item[0] }}.contents -r {{ item[1] }}" with_nested: - [ 'account', 'container' ] - - swift_managed_regions - when: swift_managed_regions is defined + - swift_managed_regions | default([]) sudo: yes sudo_user: "{{ swift_system_user_name }}" args: @@ -95,8 +94,7 @@ command: "/usr/bin/python /etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents -r {{ item[1] }}" with_nested: - "{{ swift.storage_policies }}" - - swift_managed_regions - when: swift_managed_regions is defined + - swift_managed_regions | default([]) sudo: yes sudo_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 d0b906c..039df6f 100644 --- a/tasks/swift_rings_post_distribution_check.yml +++ b/tasks/swift_rings_post_distribution_check.yml @@ -61,8 +61,7 @@ command: "/usr/bin/python /etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/{{ item[0] }}.contents -r {{ item[1] }}" with_nested: - [ 'account', 'container' ] - - swift_managed_regions - when: swift_managed_regions is defined + - swift_managed_regions | default([]) sudo: yes sudo_user: "{{ swift_system_user_name }}" args: @@ -88,8 +87,7 @@ command: "/usr/bin/python /etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents -r {{ item[1] }}" with_nested: - "{{ swift.storage_policies }}" - - swift_managed_regions - when: swift_managed_regions is defined + - swift_managed_regions | default([]) sudo: yes sudo_user: "{{ swift_system_user_name }}" args: diff --git a/tasks/swift_sync_post_install.yml b/tasks/swift_sync_post_install.yml index b553737..5b626ef 100644 --- a/tasks/swift_sync_post_install.yml +++ b/tasks/swift_sync_post_install.yml @@ -18,7 +18,10 @@ name: "{{ item }}" state: "started" pattern: "{{ item }}" - with_items: swift_account_program_names + swift_container_program_names + swift_object_program_names + with_items: + - "{{ swift_account_program_names }}" + - "{{ swift_container_program_names }}" + - "{{ swift_object_program_names }}" when: inventory_hostname in groups['swift_hosts'] - name: "Ensure services are started"