Merge "Distribute rings to build dir on all swift_hosts"

This commit is contained in:
Jenkins 2015-04-16 06:19:30 +00:00 committed by Gerrit Code Review
commit 450c061e6c
4 changed files with 19 additions and 6 deletions

View File

@ -47,7 +47,7 @@
- { path: "/etc/swift/object-server" }
- { path: "/etc/swift/proxy-server" }
- { path: "/etc/swift/scripts" }
- { path: "/etc/swift/rings" }
- { path: "/etc/swift/ring_build_files" }
- { path: "/openstack/log/{{ inventory_hostname }}", owner: "syslog", group: "syslog" }
- { path: "/var/cache/swift" }
- { path: "/var/lock/swift" }

View File

@ -58,7 +58,7 @@
sudo: yes
sudo_user: "{{ swift_system_user_name }}"
args:
chdir: /etc/swift/rings/
chdir: /etc/swift/ring_build_files/
tags:
- swift-rings
- swift-rings-build
@ -70,7 +70,7 @@
sudo: yes
sudo_user: "{{ swift_system_user_name }}"
args:
chdir: /etc/swift/rings/
chdir: /etc/swift/ring_build_files/
tags:
- swift-rings
- swift-rings-build

View File

@ -15,7 +15,7 @@
- name: Get md5sum of local builder files
shell: |
cat /etc/swift/rings/*.builder 2>/dev/null | md5sum | cut -d " " -f1
cat /etc/swift/ring_build_files/*.builder 2>/dev/null | md5sum | cut -d " " -f1
register: md5sum
tags:
- swift-ring-check

View File

@ -17,9 +17,22 @@
shell: |
rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
-avz \
{{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_ssh_host'] }}:/etc/swift/rings/ \
{{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_ssh_host'] }}:/etc/swift/ring_build_files/ \
/etc/swift/
sudo: yes
sudo_user: "{{ swift_system_user_name }}"
tags:
- swift-get-rings
# This task will backup the swift rings files on each node
# This task will prevent an issue if swift_hosts[0] were removed/changes
- name: "Copy swift rings to /etc/swift/ring_build_files for backup"
shell: |
rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
-avz \
{{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_ssh_host'] }}:/etc/swift/ring_build_files/ \
/etc/swift/ring_build_files/
sudo: yes
sudo_user: "{{ swift_system_user_name }}"
tags:
- swift-get-rings