-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-rsync.yaml
64 lines (54 loc) · 1.33 KB
/
install-rsync.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
- name: Install rsync service
hosts: maven-servers
become: true
handlers:
- name: restart_rsync
service:
name: rsync
state: restarted
- name: reload_systemd
ansible.builtin.systemd_service:
daemon_reload: true
tasks:
# From https://peterbabic.dev/blog/how-to-install-caddy-using-ansible/
- name: Install required packages
apt:
update_cache: yes
name:
- rsync
state: present
- name: Create systemd service file for rsync
copy:
dest: /etc/systemd/system/rsync.service
content: |
[Unit]
Description=Rsync Service
After=network.target
[Service]
ExecStart=/usr/bin/rsync --daemon --no-detach
Restart=always
[Install]
WantedBy=multi-user.target
owner: root
group: root
mode: 0644
notify:
- reload_systemd
- name: Enable and start rsync service
service:
name: rsync
state: started
enabled: yes
- name: Copy rsyncd config
copy:
src: files/rsyncd_docker/rsyncd.conf
dest: /etc/rsyncd.conf
owner: root
group: root
mode: 0644
notify:
- restart_rsync
- name: Show results
ansible.builtin.debug:
var: output