Add a rsyncd role. For now just to sync logs to log02, but can be extended to download later.

This commit is contained in:
Kevin Fenzi 2014-03-17 15:55:26 +00:00
parent 6e0c36316b
commit 7316ef1ca3
5 changed files with 72 additions and 1 deletions

View file

@ -34,7 +34,7 @@
- nagios_client
- fas_client
- paste
- rsyncd
tasks:
- include: "{{ tasks }}/hosts.yml"

3
roles/rsyncd/README Normal file
View file

@ -0,0 +1,3 @@
This role is for servers that have httpd access and error logs
that we wish to sync to log02 to be able to review and backup.

14
roles/rsyncd/files/rsync Normal file
View file

@ -0,0 +1,14 @@
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}

View file

@ -0,0 +1,16 @@
pid file = /var/run/rsyncd.pid
syslog facility = daemon
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.bz2 *.iso
use chroot = false
transfer logging = false
exclude = .snapshot/ .~tmp~/ /.private/ /.private/** **/.nfs*
# For distributing applications
[log]
comment = Server Logs
path = /var/log
uid = root
gid = root
read only = yes
hosts allow = 10.5.126.29 192.168.1.56

View file

@ -0,0 +1,38 @@
---
#
# This role sets up rsyncd on a server
#
- name: install rsync
yum: state=installed name=rsync
tags:
- packages
- name: rsyncd.conf file
copy: src={{ item }} dest=/etc/rsyncd.conf mode=644
with_first_found:
- "{{ rsyncd.conf }}"
- rsyncd.conf.{{ ansible_fqdn }}
- rsyncd.conf.{{ host_group }}
- rsyncd.conf.default
notify:
- restart xinetd
tags:
- config
- name: xinetd rsync file
copy: src={{ item }} dest=/etc/xinetd.d/rsync mode=644
with_first_found:
- "{{ rsync }}"
- rsync.{{ ansible_fqdn }}
- rsync.{{ host_group }}
- rsync.default
notify:
- restart xinetd
tags:
- config
- name: make sure rsync is enabled in xinetd
service: name=rsync state=started
tags:
- services