aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/swift
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/swift')
-rw-r--r--deploy/adapters/ansible/roles/swift/tasks/swift-compute1.yml22
-rw-r--r--deploy/adapters/ansible/roles/swift/tasks/swift-controller1.yml2
-rw-r--r--deploy/adapters/ansible/roles/swift/tasks/swift-controller2.yml39
-rw-r--r--deploy/adapters/ansible/roles/swift/tasks/swift.yml6
4 files changed, 30 insertions, 39 deletions
diff --git a/deploy/adapters/ansible/roles/swift/tasks/swift-compute1.yml b/deploy/adapters/ansible/roles/swift/tasks/swift-compute1.yml
index be00484b..f4f4f7b9 100644
--- a/deploy/adapters/ansible/roles/swift/tasks/swift-compute1.yml
+++ b/deploy/adapters/ansible/roles/swift/tasks/swift-compute1.yml
@@ -7,7 +7,6 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
-
- name: disable auto start
copy:
content: "#!/bin/sh\nexit 101"
@@ -39,8 +38,10 @@
- name: edit /etc/fstab
shell: >
- echo "/var/swift1 /srv/node/swift1/ xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" >> /etc/fstab;
- echo "/var/swift2 /srv/node/swift2/ xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" >> /etc/fstab;
+ echo "/var/swift1 /srv/node/swift1/ xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" \
+ >> /etc/fstab;
+ echo "/var/swift2 /srv/node/swift2/ xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" \
+ >> /etc/fstab;
mount /srv/node/swift1;
mount /srv/node/swift2;
@@ -63,18 +64,3 @@
mkdir -p /var/cache/swift;
chown -R root:swift /var/cache/swift;
chmod -R 775 /var/cache/swift;
-
-#- name: copy swift lib
-# copy: src=swift-lib.tar.gz dest=/tmp/swift-lib.tar.gz
-#
-#- name: upload swift lib
-# unarchive: src=swift-lib.tar.gz dest=/tmp/
-#
-#- name: copy swift lib
-# shell: command: su -s /bin/sh -c "cp /tmp/swift-lib/* /usr/lib/"
-#
-#- name: untar swift lib
-# shell: >
-# tar zxf /tmp/swift-lib.tar.gz;
-# cp /tmp/swift-lib/* /usr/lib/;
-
diff --git a/deploy/adapters/ansible/roles/swift/tasks/swift-controller1.yml b/deploy/adapters/ansible/roles/swift/tasks/swift-controller1.yml
index 36d05040..7346da10 100644
--- a/deploy/adapters/ansible/roles/swift/tasks/swift-controller1.yml
+++ b/deploy/adapters/ansible/roles/swift/tasks/swift-controller1.yml
@@ -30,5 +30,3 @@
- name: update proxy-server conf
template: src=proxy-server.conf dest=/etc/swift/proxy-server.conf backup=yes
-
-
diff --git a/deploy/adapters/ansible/roles/swift/tasks/swift-controller2.yml b/deploy/adapters/ansible/roles/swift/tasks/swift-controller2.yml
index 92d4ab22..75e77882 100644
--- a/deploy/adapters/ansible/roles/swift/tasks/swift-controller2.yml
+++ b/deploy/adapters/ansible/roles/swift/tasks/swift-controller2.yml
@@ -7,17 +7,20 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
-
- name: create account.builder file
shell: >
- cd /etc/swift ;
+ cd /etc/swift;
swift-ring-builder account.builder create 10 3 1;
- name: add each storage node to the ring
shell: >
cd /etc/swift;
- swift-ring-builder account.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6002 --device swift1 --weight 100 ;
- swift-ring-builder account.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6002 --device swift2 --weight 100 ;
+ swift-ring-builder account.builder add --region 1 --zone 1 \
+ --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6002 \
+ --device swift1 --weight 100 ;
+ swift-ring-builder account.builder add --region 1 --zone 1 \
+ --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6002 \
+ --device swift2 --weight 100 ;
with_indexed_items: groups['compute']
- name: verify the ring contents 1
@@ -30,8 +33,6 @@
cd /etc/swift;
swift-ring-builder account.builder rebalance;
-
-#####################
- name: create contrainer builder file
shell: >
cd /etc/swift;
@@ -40,8 +41,12 @@
- name: add each storage node to the ring
shell: >
cd /etc/swift;
- swift-ring-builder container.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6001 --device swift1 --weight 100;
- swift-ring-builder container.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6001 --device swift2 --weight 100;
+ swift-ring-builder container.builder add --region 1 --zone 1 \
+ --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6001 \
+ --device swift1 --weight 100;
+ swift-ring-builder container.builder add --region 1 --zone 1 \
+ --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6001 \
+ --device swift2 --weight 100;
with_indexed_items: groups['compute']
- name: verify the ring contents 2
@@ -54,8 +59,6 @@
cd /etc/swift;
swift-ring-builder container.builder rebalance;
-#############################
-
- name: create object builder file
shell: >
cd /etc/swift;
@@ -64,8 +67,12 @@
- name: add each storage node to the ring
shell: >
cd /etc/swift;
- swift-ring-builder object.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6000 --device swift1 --weight 100;
- swift-ring-builder object.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6000 --device swift2 --weight 100;
+ swift-ring-builder object.builder add --region 1 --zone 1 \
+ --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6000 \
+ --device swift1 --weight 100;
+ swift-ring-builder object.builder add --region 1 --zone 1 \
+ --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6000 \
+ --device swift2 --weight 100;
with_indexed_items: groups['compute']
- name: verify the ring contents
@@ -78,16 +85,16 @@
cd /etc/swift;
swift-ring-builder object.builder rebalance;
-##########################
-
- name: distribute ring configuration files to the other controller
shell: >
cd /etc/swift;
- scp account.ring.gz container.ring.gz object.ring.gz root@{{ ip_settings[item.1]['mgmt']['ip'] }}:/etc/swift/;
+ scp account.ring.gz container.ring.gz object.ring.gz \
+ root@{{ ip_settings[item.1]['mgmt']['ip'] }}:/etc/swift/;
with_indexed_items: groups['controller']
- name: distribute ring configuration files to the all compute
shell: >
cd /etc/swift;
- scp account.ring.gz container.ring.gz object.ring.gz root@{{ ip_settings[item.1]['mgmt']['ip'] }}:/etc/swift/;
+ scp account.ring.gz container.ring.gz object.ring.gz \
+ root@{{ ip_settings[item.1]['mgmt']['ip'] }}:/etc/swift/;
with_indexed_items: groups['compute']
diff --git a/deploy/adapters/ansible/roles/swift/tasks/swift.yml b/deploy/adapters/ansible/roles/swift/tasks/swift.yml
index 4e2651a7..473c2710 100644
--- a/deploy/adapters/ansible/roles/swift/tasks/swift.yml
+++ b/deploy/adapters/ansible/roles/swift/tasks/swift.yml
@@ -34,7 +34,7 @@
- name: restart tasks on compute
shell: swift-init all start
when: inventory_hostname in groups['compute']
- ignore_errors: True
+ ignore_errors: "True"
- name: restart tasks on controller
service: name={{ item }} state=restarted enabled=yes
@@ -68,7 +68,7 @@
- swift-container-updater
- swift-object-replicator
when: inventory_hostname in groups['compute']
- ignore_errors: True
+ ignore_errors: "True"
- name: restart swift task
shell: >
@@ -76,4 +76,4 @@
sleep 10;
for i in `cat /opt/swift-service`; do service $i restart; done;
when: inventory_hostname in groups['compute']
- ignore_errors: True
+ ignore_errors: "True"