rsyncd: modernize tasks for fedora and rhel versions with xinetd and rsyncd.service
We don't have any more fedora instances that are f34 or before (with xinetd was dropped) and now we have some rhel9 hosts that don't have xinetd. So, adjust the tasks to always use the systemd service on fedora and rhel9 and use xinetd on rhel7/8. Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
parent
58522e59f9
commit
7139709ebd
1 changed files with 15 additions and 16 deletions
|
@ -13,7 +13,7 @@
|
||||||
tags:
|
tags:
|
||||||
- packages
|
- packages
|
||||||
- rsyncd
|
- rsyncd
|
||||||
when: (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int < 8) or (ansible_distribution_major_version|int < 30 and ansible_distribution == 'Fedora')
|
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int < 8
|
||||||
|
|
||||||
- name: install necessary packages
|
- name: install necessary packages
|
||||||
package:
|
package:
|
||||||
|
@ -25,9 +25,9 @@
|
||||||
tags:
|
tags:
|
||||||
- packages
|
- packages
|
||||||
- rsyncd
|
- rsyncd
|
||||||
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)
|
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 8
|
||||||
|
|
||||||
- name: install necessary packages for fedora >= 34
|
- name: install necessary packages for fedora or rhel9
|
||||||
package:
|
package:
|
||||||
state: present
|
state: present
|
||||||
name:
|
name:
|
||||||
|
@ -36,9 +36,9 @@
|
||||||
tags:
|
tags:
|
||||||
- packages
|
- packages
|
||||||
- rsyncd
|
- rsyncd
|
||||||
when: (ansible_distribution_major_version|int >= 34 and ansible_distribution == 'Fedora') or (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int > 8)
|
when: ansible_distribution == 'Fedora' or (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int > 8)
|
||||||
|
|
||||||
- name: rsyncd.conf file
|
- name: rsyncd.conf file for non download servers
|
||||||
copy: src={{ item }} dest=/etc/rsyncd.conf mode=0644
|
copy: src={{ item }} dest=/etc/rsyncd.conf mode=0644
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ rsyncd_conf }}"
|
- "{{ rsyncd_conf }}"
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
- config
|
- config
|
||||||
- rsyncd
|
- rsyncd
|
||||||
|
|
||||||
- name: rsyncd.conf file
|
- name: rsyncd.conf file for download servers
|
||||||
template: src=rsyncd.conf.download.j2 dest=/etc/rsyncd.conf mode=0644
|
template: src=rsyncd.conf.download.j2 dest=/etc/rsyncd.conf mode=0644
|
||||||
notify:
|
notify:
|
||||||
- restart daemon
|
- restart daemon
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
- config
|
- config
|
||||||
- rsyncd
|
- rsyncd
|
||||||
|
|
||||||
- name: xinetd rsync file
|
- name: xinetd rsync file for rhel7 and rhel8
|
||||||
copy: src={{ item }} dest=/etc/xinetd.d/rsync mode=0644
|
copy: src={{ item }} dest=/etc/xinetd.d/rsync mode=0644
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ rsync }}"
|
- "{{ rsync }}"
|
||||||
|
@ -73,30 +73,30 @@
|
||||||
- rsync.default
|
- rsync.default
|
||||||
notify:
|
notify:
|
||||||
- restart xinetd
|
- restart xinetd
|
||||||
when: ansible_distribution_major_version|int < 34 and ansible_distribution == 'Fedora'
|
when: ansible_distribution_major_version|int < 9 and ansible_distribution == 'RedHat'
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
- rsyncd
|
- rsyncd
|
||||||
|
|
||||||
- name: systemd rsync file
|
- name: systemd rsync file for fedora and rhel9
|
||||||
copy: src=rsyncd.service dest=/usr/lib/systemd/system/rsyncd.service mode=0644
|
copy: src=rsyncd.service dest=/usr/lib/systemd/system/rsyncd.service mode=0644
|
||||||
when: (ansible_distribution_major_version|int >= 34 and ansible_distribution == 'Fedora') or (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int > 8)
|
when: ansible_distribution == 'Fedora' or (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int > 8)
|
||||||
notify:
|
notify:
|
||||||
- restart daemon
|
- restart daemon
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
- rsyncd
|
- rsyncd
|
||||||
|
|
||||||
- name: make sure xinetd is started
|
- name: make sure xinetd is started on rhel7 and rhel8
|
||||||
service: name=xinetd state=started
|
service: name=xinetd state=started enabled=true
|
||||||
when: ansible_distribution_major_version|int < 34 and ansible_distribution == 'Fedora'
|
when: ansible_distribution_major_version|int < 9 and ansible_distribution == 'RedHat'
|
||||||
tags:
|
tags:
|
||||||
- services
|
- services
|
||||||
- rsyncd
|
- rsyncd
|
||||||
|
|
||||||
- name: make sure rsync daemon is started
|
- name: make sure rsync daemon is started on Fedora and rhel9
|
||||||
service: name=rsyncd enabled=true state=started
|
service: name=rsyncd enabled=true state=started
|
||||||
when: ansible_distribution_major_version|int >= 34 and ansible_distribution == 'Fedora'
|
when: ansible_distribution == 'Fedora' or (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int > 8)
|
||||||
tags:
|
tags:
|
||||||
- services
|
- services
|
||||||
- rsyncd
|
- rsyncd
|
||||||
|
@ -107,4 +107,3 @@
|
||||||
persistent=true
|
persistent=true
|
||||||
tags:
|
tags:
|
||||||
- rsyncd
|
- rsyncd
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue