Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.0 KiB

---
- name: Install packages
yum:
name:
- rsync
- libsemanage-python
when: ansible_os_family == 'RedHat'
tags: rsync
- name: Install packages
apt: name=rsync
when: ansible_os_family == 'Debian'
tags: rsync
- name: Handle rsyncd port
iptables_raw:
name: rsync_port
state: "{{ (rsync_src_ip | length > 0) | ternary('present','absent') }}"
rules: "-A INPUT -m state --state NEW -p tcp --dport {{ rsync_port }} -s {{ rsync_src_ip | join(',') }} -j ACCEPT"
when: iptables_manage | default(True)
tags: [firewall,rsync]
- name: Create rsyncd.d directory
file: path=/etc/rsyncd.conf.d state=directory
tags: rsync
- name: Deploy rsyncd conf
template: src=rsyncd.conf.j2 dest=/etc/rsyncd.conf
tags: rsync
- name: Allow rsync full access in SELinux
seboolean: name=rsync_full_access state=True persistent=True
when: ansible_selinux.status == 'enabled'
tags: rsync
- name: Start and enable rsync daemon
systemd: name=rsyncd.socket state=started enabled=True
tags: rsync