Adjust the ring-builder to happen on the local host

* This needs to be built on the host (where the inventory file is)
* Copy up from local host to remote hosts
* Tag directory creation from container_common
* Run against only swift_hosts and swift_proxy (Avoids running against proxy containers)
This commit is contained in:
Andy McCrae 2014-09-26 15:20:09 +00:00 committed by Andy McCrae
parent e787a0de43
commit d3d64d75d9
4 changed files with 20 additions and 20 deletions

View File

@ -1,10 +1,14 @@
---
- hosts: swift_all[0]
- hosts: local
user: root
roles:
- { role: container_common, tags: [ 'directories' ] }
- openstack_common
- swift_ring_builder
vars_files:
- inventory/group_vars/swift_all.yml
- hosts: swift_all:!swift_all[0]
- hosts: swift_hosts:swift_proxy
user: root
roles:
- swift_ring_distribute

View File

@ -22,3 +22,5 @@
recurse=true
when: container_directories is defined
with_items: container_directories
tags:
- directories

View File

@ -2,28 +2,20 @@
- name: "make sure scripts directory exists"
file: >
state=directory
path=/etc/swift/scripts/
path={{ item }}
owner=root
group=root
mode=0755
with_items:
- /tmp/swift/rings
- /tmp/swift/scripts
- name: "Retrieve the swift_rings.py file"
- name: "Copy the swift_rings.py file"
copy: >
src=swift_rings.py
dest="/etc/swift/scripts/swift_rings.py"
dest="/tmp/swift/scripts/swift_rings.py"
#- name: "build rings"
# command: /usr/bin/python /etc/swift/scripts/swift_rings.py -s /etc/rpc_deploy/rpc_user_config.yml
# args:
# chdir: /etc/swift/rings/
- name: "List ring files to copy over"
command: "/bin/ls /etc/swift/rings/"
register: ringfiles
- name: "Fetch rings to local server"
fetch: >
src="/etc/swift/rings/{{ item }}"
dest=/tmp/swift/rings/
flat=yes
with_items: ringfiles.stdout_lines
- name: "build rings"
command: /usr/bin/python /tmp/swift/scripts/swift_rings.py -s /etc/rpc_deploy/rpc_user_config.yml
args:
chdir: /tmp/swift/rings/

View File

@ -4,3 +4,5 @@
src=/tmp/swift/rings/
dest=/etc/swift/rings/
mode=0644
owner={{ system_user }}
group={{ system_group }}