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
|
|
|
#
|
|
|
|
|
2019-09-02 12:14:18 +02:00
|
|
|
- name: install necessary packages
|
2019-06-11 17:42:38 +02:00
|
|
|
package:
|
|
|
|
state: present
|
|
|
|
name:
|
|
|
|
- rsync
|
|
|
|
- xinetd
|
|
|
|
- libsemanage-python
|
2014-03-17 16:11:23 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
2017-03-09 21:08:00 +00:00
|
|
|
- rsyncd
|
2019-09-19 19:27:25 +00:00
|
|
|
when: ansible_distribution_major_version|int < 8 and ansible_distribution == 'RedHat'
|
2015-11-09 17:45:16 +00:00
|
|
|
|
2019-09-02 12:14:18 +02:00
|
|
|
- name: install necessary packages
|
2019-06-11 17:42:38 +02:00
|
|
|
package:
|
|
|
|
state: present
|
|
|
|
name:
|
|
|
|
- rsync
|
|
|
|
- xinetd
|
|
|
|
- libsemanage-python
|
2015-11-09 17:45:16 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
2017-03-09 21:08:00 +00:00
|
|
|
- rsyncd
|
2019-09-19 19:27:25 +00:00
|
|
|
when: ansible_distribution_major_version|int >= 8 and ansible_distribution == 'RedHat'
|
2019-09-02 12:14:18 +02:00
|
|
|
|
|
|
|
- name: install necessary packages
|
|
|
|
package:
|
|
|
|
state: present
|
|
|
|
name:
|
|
|
|
- rsync
|
|
|
|
- xinetd
|
|
|
|
- libsemanage-python
|
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
- rsyncd
|
2019-09-19 19:27:25 +00:00
|
|
|
when: ansible_distribution_major_version|int >= 29 and ansible_distribution == 'Fedora'
|
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
|