Initial commit
This commit is contained in:
parent
e99efc68e3
commit
bba5262e57
8 changed files with 231 additions and 0 deletions
69
roles/nginx_cluster/templates/lsynd.conf.j2
Normal file
69
roles/nginx_cluster/templates/lsynd.conf.j2
Normal file
|
@ -0,0 +1,69 @@
|
|||
targets = { {{ nodelist }} }
|
||||
|
||||
settings {
|
||||
logfile = "/var/log/lsyncd/lsyncd.log",
|
||||
statusFile = "/var/log/lsyncd/lsyncd.status",
|
||||
statusInterval = 1,
|
||||
nodaemon = true,
|
||||
insist = true
|
||||
}
|
||||
|
||||
for _, target in ipairs( targets )
|
||||
do
|
||||
-- Site Data Sync
|
||||
sync {
|
||||
default.{{ nginx_cluser_lsyncd_mode }},
|
||||
host = target,
|
||||
source = "{{ nginx_cluser_sync_site_dir }}",
|
||||
targetdir = "{{ nginx_cluser_sync_site_dir }}",
|
||||
delay = {{ nginx_cluser_lsyncd_delay }},
|
||||
rsync = {
|
||||
times = {{ nginx_cluser_lsyncd_rsync_times }},
|
||||
archive = {{ nginx_cluser_lsyncd_rsync_archive }},
|
||||
compress = {{ nginx_cluser_lsyncd_rsync_compress }},
|
||||
perms = {{ nginx_cluser_lsyncd_rsync_perms }},
|
||||
acls = {{ nginx_cluser_lsyncd_rsync_acls }},
|
||||
owner = {{ nginx_cluser_lsyncd_rsync_owner }},
|
||||
rsh = "/usr/bin/ssh -l {{ nginx_cluster_user }} -i {{ nginx_cluster_private_key }} -o StrictHostKeyChecking=no",
|
||||
temp_dir = "{{ nginx_cluster_temp_dir }}"
|
||||
}
|
||||
}
|
||||
|
||||
-- Nginx Config Sync
|
||||
sync {
|
||||
default.{{ nginx_cluser_lsyncd_mode }},
|
||||
host = target,
|
||||
source = "{{ nginx_cluser_sync_config_dir }}",
|
||||
targetdir = "{{ nginx_cluser_sync_config_dir }}",
|
||||
delay = {{ nginx_cluser_lsyncd_delay }},
|
||||
rsync = {
|
||||
times = {{ nginx_cluser_lsyncd_rsync_times }},
|
||||
archive = {{ nginx_cluser_lsyncd_rsync_archive }},
|
||||
compress = {{ nginx_cluser_lsyncd_rsync_compress }},
|
||||
perms = {{ nginx_cluser_lsyncd_rsync_perms }},
|
||||
acls = {{ nginx_cluser_lsyncd_rsync_acls }},
|
||||
owner = {{ nginx_cluser_lsyncd_rsync_owner }},
|
||||
rsh = "/usr/bin/ssh -l {{ nginx_cluster_user }} -i {{ nginx_cluster_private_key }} -o StrictHostKeyChecking=no",
|
||||
temp_dir = "{{ nginx_cluster_temp_dir }}"
|
||||
}
|
||||
}
|
||||
|
||||
-- PHP Config Sync
|
||||
sync {
|
||||
default.{{ nginx_cluser_lsyncd_mode }},
|
||||
host = target,
|
||||
source = "{{ nginx_cluser_sync_php_config_dir }}",
|
||||
targetdir = "{{ nginx_cluser_sync_php_config_dir }}",
|
||||
delay = {{ nginx_cluser_lsyncd_delay }},
|
||||
rsync = {
|
||||
times = {{ nginx_cluser_lsyncd_rsync_times }},
|
||||
archive = {{ nginx_cluser_lsyncd_rsync_archive }},
|
||||
compress = {{ nginx_cluser_lsyncd_rsync_compress }},
|
||||
perms = {{ nginx_cluser_lsyncd_rsync_perms }},
|
||||
acls = {{ nginx_cluser_lsyncd_rsync_acls }},
|
||||
owner = {{ nginx_cluser_lsyncd_rsync_owner }},
|
||||
rsh = "/usr/bin/ssh -l {{ nginx_cluster_user }} -i {{ nginx_cluster_private_key }} -o StrictHostKeyChecking=no",
|
||||
temp_dir = "{{ nginx_cluster_temp_dir }}"
|
||||
}
|
||||
}
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue