summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2015-03-03 17:07:39 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2015-03-03 17:07:39 +0000
commit64417c09376f415024abf973381b2d53576abb32 (patch)
treed1e5a4e00f9465f9e22893cefe81ea2b3e447cf6
parenta813a85277f2f504e64f6ccec3fd3026cb0092b2 (diff)
downloaddefinitions-64417c09376f415024abf973381b2d53576abb32.tar.gz
swift-controller.yml: Create all the rings!
-rw-r--r--openstack/usr/share/openstack/swift-controller.yml22
1 files changed, 15 insertions, 7 deletions
diff --git a/openstack/usr/share/openstack/swift-controller.yml b/openstack/usr/share/openstack/swift-controller.yml
index 1101eccd..272f0b50 100644
--- a/openstack/usr/share/openstack/swift-controller.yml
+++ b/openstack/usr/share/openstack/swift-controller.yml
@@ -2,6 +2,7 @@
- hosts: localhost
vars_files:
- swift-vars.yml
+ - rings: ['account', 'container', 'object']
remote_user: root
tasks:
- user: name=swift comment="Swift user"
@@ -30,17 +31,24 @@
region='RegionOne'
token={{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}
- - name: Create account ring
- shell: swift-ring-builder account.builder create {{ SWIFT_PART_POWER }}
+ - name: Create ring
+ shell: swift-ring-builder {{ item }}.builder create {{ SWIFT_PART_POWER }}
{{ SWIFT_REPLICAS }} {{ SWIFT_MIN_PART_HOURS }}
+ with_items: rings
- name: Add each storage node to the ring
- shell: swift-ring-builder account.builder
- add r1z1-{{ item.ip }}:6002/{{ item.device}} {{ item.weight }}
- with_items: "{{ SWIFT_STORAGE_DEVICES }}"
+ shell: swift-ring-builder {{ item[0] }}.builder
+ add r1z1-{{ item[1].ip }}:6002/{{ item[1].device }} {{ item[1].weight }}
+ with_nested:
+ - rings
+ - "{{ SWIFT_STORAGE_DEVICES }}"
- name: Rebalance the ring
- shell: swift-ring-builder account.builder rebalance
+ shell: swift-ring-builder {{ item }}.builder rebalance
+ with_items:
+ - rings
- name: Transfer ring to /etc/swift on each node
- shell: cp account.builder /etc/swift
+ shell: cp {{ item }}.builder /etc/swift
+ with_items:
+ - rings