Merge pull request #593 from andymcc/rsync_swift

Setup rsync for swift
This commit is contained in:
Andy McCrae 2014-11-20 13:33:57 +00:00
commit d9d2d8f58d
4 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,23 @@
---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Restart rsync service
service: name=rsync state=restarted pattern=rsync
register: service_restart
failed_when: "'msg' in service_restart and 'FAIL' in service_restart.msg|upper"
notify: Ensure rsync service running
- name: Ensure rsync service running
service: name=rsync state=started pattern=rsync

View File

@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: rsync_setup.yml
- name: "Set ownership on mounted drives"
file:
dest: "{{ swift_vars.mount_point | default(swift.mount_point) }}/{{ item.name }}"

View File

@ -0,0 +1,29 @@
---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: "Put /etc/rsyncd.conf in place"
template: >
src=rsyncd.conf.j2
dest=/etc/rsyncd.conf
owner=root
mode=0644
notify: Restart rsync service
- name: "Enable rsync in defaults"
lineinfile: >
dest=/etc/default/rsync
line="RSYNC_ENABLE=true"
regexp="^RSYNC_ENABLE*"
notify: Restart rsync service

View File

@ -0,0 +1,30 @@
{% if is_metal == true and swift.replication_network is defined %}
{% set repl_bridge = 'ansible_' + swift.replication_network|replace('-', '_') %}
{% set bind_ip = hostvars[inventory_hostname][repl_bridge]['ipv4']['address'] %}
{% elif is_metal == true and swift.storage_network is defined %}
{% set storage_bridge = 'ansible_' + swift.storage_network|replace('-', '_') %}
{% set bind_ip = hostvars[inventory_hostname][storage_bridge]['ipv4']['address'] %}
{% endif %}
uid = {{ system_user }}
gid = {{ system_user }}
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = {{ bind_ip | default(container_address) }}
[account]
max connections = 2
path = {{ swift_vars.mount_point | default(swift.mount_point) }}
read only = false
lock file = /var/lock/account.lock
[container]
max connections = 2
path = {{ swift_vars.mount_point | default(swift.mount_point) }}
read only = false
lock file = /var/lock/container.lock
[object]
max connections = 2
path = {{ swift_vars.mount_point | default(swift.mount_point) }}
read only = false
lock file = /var/lock/object.lock