ansible/roles/rsyncd/tasks/main.yml

92 lines
1.9 KiB
YAML
Raw Normal View History

---
#
2016-08-08 19:36:31 +00:00
# This role sets up rsyncd on a server
#
- name: install necessary packages
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
when: ansible_distribution_major_version|int < 8 and ansible_distribution == 'RedHat'
2015-11-09 17:45:16 +00:00
- name: install necessary packages
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
when: ansible_distribution_major_version|int >= 8 and ansible_distribution == 'RedHat'
- name: install necessary packages
package:
state: present
name:
- rsync
- xinetd
- libsemanage-python
tags:
- packages
- rsyncd
when: ansible_distribution_major_version|int >= 29 and ansible_distribution == 'Fedora'
2014-03-17 16:11:23 +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
- name: rsyncd.conf file
template: src=rsyncd.conf.download.j2 dest=/etc/rsyncd.conf mode=0644
notify:
- restart xinetd
when: "'download' in group_names"
tags:
- config
2017-03-09 21:08:00 +00:00
- rsyncd
- name: xinetd rsync file
copy: src={{ item }} dest=/etc/xinetd.d/rsync mode=0644
with_first_found:
- "{{ rsync }}"
- rsync.{{ inventory_hostname }}
- rsync.{{ host_group }}
- rsync.{{ rsync_group }}
- rsync.default
notify:
- restart xinetd
tags:
- config
2017-03-09 21:08:00 +00:00
- rsyncd
2014-03-17 16:09:11 +00:00
- name: make sure xinetd is started
service: name=xinetd state=started
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