2014-03-17 15:55:26 +00:00
|
|
|
---
|
|
|
|
#
|
2016-08-08 19:36:31 +00:00
|
|
|
# This role sets up rsyncd on a server
|
2014-03-17 15:55:26 +00:00
|
|
|
#
|
|
|
|
|
2014-07-29 21:24:48 +00:00
|
|
|
- name: install rnecessary packages
|
2014-10-29 09:08:40 +05:30
|
|
|
yum: state=present name={{item}}
|
2014-07-29 21:24:48 +00:00
|
|
|
with_items:
|
|
|
|
- rsync
|
|
|
|
- xinetd
|
|
|
|
- libsemanage-python
|
2014-03-17 16:11:23 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
2017-03-09 21:08:00 +00:00
|
|
|
- rsyncd
|
2015-11-09 17:45:16 +00:00
|
|
|
when: ansible_distribution_major_version|int < 22
|
|
|
|
|
|
|
|
- name: install rnecessary packages
|
|
|
|
dnf: state=present name={{item}}
|
|
|
|
with_items:
|
|
|
|
- rsync
|
|
|
|
- xinetd
|
|
|
|
- libsemanage-python
|
|
|
|
tags:
|
|
|
|
- packages
|
2017-03-09 21:08:00 +00:00
|
|
|
- rsyncd
|
2015-11-09 17:45:16 +00:00
|
|
|
when: ansible_distribution_major_version|int > 21
|
2014-03-17 16:11:23 +00:00
|
|
|
|
2017-06-27 13:39:17 +00:00
|
|
|
- name: rsyncd.conf file
|
|
|
|
copy: src={{ item }} dest=/etc/rsyncd.conf mode=0644
|
|
|
|
with_first_found:
|
|
|
|
- "{{ rsyncd_conf }}"
|
|
|
|
- rsyncd.conf.{{ inventory_hostname }}
|
|
|
|
- rsyncd.conf.{{ host_group }}
|
|
|
|
- rsyncd.conf.{{ rsync_group }}
|
|
|
|
- rsyncd.conf.default
|
|
|
|
when: "'download' not in group_names"
|
|
|
|
notify:
|
|
|
|
- restart xinetd
|
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- rsyncd
|
2017-06-26 18:30:27 +00:00
|
|
|
|
2014-03-17 15:55:26 +00:00
|
|
|
- name: rsyncd.conf file
|
2017-06-26 18:30:27 +00:00
|
|
|
template: src=rsyncd.conf.download.j2 dest=/etc/rsyncd.conf mode=0644
|
2014-03-17 15:55:26 +00:00
|
|
|
notify:
|
|
|
|
- restart xinetd
|
2017-06-27 13:39:17 +00:00
|
|
|
when: "'download' in group_names"
|
2014-03-17 15:55:26 +00:00
|
|
|
tags:
|
|
|
|
- config
|
2017-03-09 21:08:00 +00:00
|
|
|
- rsyncd
|
2014-03-17 15:55:26 +00:00
|
|
|
|
|
|
|
- name: xinetd rsync file
|
2016-08-08 19:53:57 +00:00
|
|
|
copy: src={{ item }} dest=/etc/xinetd.d/rsync mode=0644
|
2014-03-17 15:55:26 +00:00
|
|
|
with_first_found:
|
|
|
|
- "{{ rsync }}"
|
2016-05-11 15:08:50 +00:00
|
|
|
- rsync.{{ inventory_hostname }}
|
2014-03-17 15:55:26 +00:00
|
|
|
- rsync.{{ host_group }}
|
2014-05-21 15:47:07 +00:00
|
|
|
- rsync.{{ rsync_group }}
|
2014-03-17 15:55:26 +00:00
|
|
|
- rsync.default
|
|
|
|
notify:
|
|
|
|
- restart xinetd
|
|
|
|
tags:
|
|
|
|
- config
|
2017-03-09 21:08:00 +00:00
|
|
|
- rsyncd
|
2014-03-17 15:55:26 +00:00
|
|
|
|
2014-03-17 16:09:11 +00:00
|
|
|
- name: make sure xinetd is started
|
|
|
|
service: name=xinetd state=started
|
2014-03-17 15:55:26 +00:00
|
|
|
tags:
|
|
|
|
- services
|
2017-03-09 21:08:00 +00:00
|
|
|
- rsyncd
|
2014-05-21 17:38:51 +00:00
|
|
|
|
|
|
|
- name: set sebooleans so rsync can read dirs
|
2016-01-06 21:58:31 +00:00
|
|
|
seboolean: name=rsync_export_all_ro
|
2014-05-21 17:38:51 +00:00
|
|
|
state=true
|
|
|
|
persistent=true
|
2017-03-09 21:08:00 +00:00
|
|
|
tags:
|
|
|
|
- rsyncd
|