replace xinetd by systemd for fedora >= 34
This commit is contained in:
parent
3f5cb87166
commit
dc576316fd
3 changed files with 54 additions and 3 deletions
13
roles/rsyncd/files/rsyncd.service
Normal file
13
roles/rsyncd/files/rsyncd.service
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=fast remote file copy program daemon
|
||||
ConditionPathExists=/etc/rsyncd.conf
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/sysconfig/rsyncd
|
||||
ExecStart=/usr/bin/rsync --daemon --no-detach "$OPTIONS"
|
||||
#StandardInput=socket
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
6
roles/rsyncd/handlers/main.yml
Normal file
6
roles/rsyncd/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: restart xinetd
|
||||
service: name=xinetd state=restarted
|
||||
|
||||
- name: restart daemon
|
||||
service: name=rsyncd daemon_reload=yes state=restarted
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
|
||||
- name: install necessary packages
|
||||
package:
|
||||
package:
|
||||
state: present
|
||||
name:
|
||||
- rsync
|
||||
|
@ -25,7 +25,18 @@
|
|||
tags:
|
||||
- packages
|
||||
- rsyncd
|
||||
when: (ansible_distribution_major_version|int >= 30 and ansible_distribution == 'Fedora') or (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int >= 8)
|
||||
when: (ansible_distribution_major_version|int >= 30 and ansible_distribution == 'Fedora' and ansible_distribution_major_version|int < 34 and ansible_distribution == 'Fedora') or (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int >= 8)
|
||||
|
||||
- name: install necessary packages for fedora >= 34
|
||||
package:
|
||||
state: present
|
||||
name:
|
||||
- rsync-daemon
|
||||
- python3-libsemanage
|
||||
tags:
|
||||
- packages
|
||||
- rsyncd
|
||||
when: (ansible_distribution_major_version|int >= 34 and ansible_distribution == 'Fedora') or (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int >= 8)
|
||||
|
||||
- name: rsyncd.conf file
|
||||
copy: src={{ item }} dest=/etc/rsyncd.conf mode=0644
|
||||
|
@ -38,6 +49,8 @@
|
|||
when: "'download' not in group_names"
|
||||
notify:
|
||||
- restart xinetd
|
||||
- restart daemon
|
||||
ignore_errors: true
|
||||
tags:
|
||||
- config
|
||||
- rsyncd
|
||||
|
@ -61,19 +74,38 @@
|
|||
- rsync.default
|
||||
notify:
|
||||
- restart xinetd
|
||||
when: ansible_distribution_major_version|int < 34 and ansible_distribution == 'Fedora'
|
||||
tags:
|
||||
- config
|
||||
- rsyncd
|
||||
|
||||
- name: systemd rsync file
|
||||
copy: src=rsyncd.service dest=/usr/lib/systemd/system/rsyncd.service mode=0644
|
||||
when: ansible_distribution_major_version|int >= 34 and ansible_distribution == 'Fedora'
|
||||
notify:
|
||||
- restart daemon
|
||||
tags:
|
||||
- config
|
||||
- rsyncd
|
||||
|
||||
- name: make sure xinetd is started
|
||||
service: name=xinetd state=started
|
||||
when: ansible_distribution_major_version|int < 34 and ansible_distribution == 'Fedora'
|
||||
tags:
|
||||
- services
|
||||
- rsyncd
|
||||
|
||||
- name: make sure rsync daemon is started
|
||||
service: name=rsyncd enabled=true state=started
|
||||
when: ansible_distribution_major_version|int >= 34 and ansible_distribution == 'Fedora'
|
||||
tags:
|
||||
- services
|
||||
- rsyncd
|
||||
|
||||
- name: set sebooleans so rsync can read dirs
|
||||
seboolean: name=rsync_export_all_ro
|
||||
state=true
|
||||
persistent=true
|
||||
tags:
|
||||
- rsyncd
|
||||
- rsyncd
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue