added ansible for deployment in private infrastrucutre

This commit is contained in:
2021-05-21 12:44:15 +04:00
parent 64bc064e56
commit 616f161c36
51 changed files with 864 additions and 0 deletions

View File

View File

@@ -0,0 +1,16 @@
motd file = /etc/rsyncd.motd
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
[jupyter_data]
path = /nfs/jupyter/data
comment = Jupyter data files
uid = nobody
gid = nobody
read only = yes
list = yes
auth users = @rsync:ro
secrets file = /etc/rsyncd.secrets
hosts allow = 192.168.1.0/24
hosts deny = 0.0.0.0/0

View File

@@ -0,0 +1,5 @@
---
- name: restart the rsync service
systemd:
name: "{{ rsync.service_name }}"
state: restarted

View File

View File

@@ -0,0 +1,26 @@
---
# Configure the rsync daemon on the master
- name: copy rsync.conf up to the server
copy:
src: "{{ rsync.config_file.src }}"
dest: "{{ rsync.config_file.dest }}"
notify:
- restart the rsync service
when: inventory_hostname == rsync.master
- name: configure rsync on the server
service:
enabled: yes
name: "{{ rsync.service_name }}"
state: started
when: inventory_hostname == rsync.master
# Synchronize the data folder across hosts
- name: synchronize the data folder
delegate_to: "{{ rsync.master }}"
synchronize:
src: "{{ sync.source }}"
dest: "{{ sync.destination }}"
rsync_opts: "{{ rsync.options }}"
use_ssh_args: yes
when: inventory_hostname != rsync.master

View File

View File

@@ -0,0 +1,10 @@
---
rsync:
config_file:
src: rsyncd.conf
dest: /etc/rsyncd.conf
master: ml1
options:
- "-e ssh"
- "--no-motd"
service_name: rsync