-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.yml
84 lines (76 loc) · 3.48 KB
/
config.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
log:
destination: stdout # stdout or /path/to/log, ie /var/log/poni.log
level: error # info, error, warning, debug (for development)
### optional Global sync settings
defaults:
source_path: /opt/dir1
remote_host: nycweb1
remote_path: /tmp
remote_user: bob
priv_key: /home/bob/.ssh/id_rsa
rsync_opts: azP
interval: 3
recurse: false
port: 22
simulate: true
## Remote syncs (can specify sync settings for each file or folder)
sync:
## these syncs use specific sync values
"sync dir3 to nycweb1:/opt": # unique name for each sync
source_path: /opt/dir3
remote_host: nycweb1
remote_path: /opt
remote_user: jsmith
priv_key: /home/jsmith/.ssh/id_rsa
rsync_opts: azBP
interval: 15
recurse: true
simulate: false
################################################################################
## this sync will use Default values from "defaults" section above
## will sync source_host:source_path > remote_host:remote_path, using all default settings
## ie, localhost:/opt/dir1 > nycweb1:/tmp
"sync default path to nycweb1:/tmp": []
################################################################################
## sync only files inside /home/joe/test, not entire "test" directory, place "/" at end of source path
## ie, if theres are 2 files in /home/joe/test (/home/joe/test/file1, file2) only these 2 files will be syncted to webhost2:/tmp, not entire "test" directory
"sync only files in /home/joe/test not entire test dir":
source_path: /home/joe/test/
remote_host: webhost2
remote_path: /tmp/
remote_user: joe
priv_key: /home/joe/.ssh/id_ed25519
## all other options like recurse, interval etc, will come from Defaults
################################################################################
### sync same directory or file to multiple destinations
### will rsync config.json to both Joe and Linda's macs as well to default target "nycweb1"
"sync to Joe":
source_path: /var/shared/config.json
remote_host: joes-mac
remote_path: /Users/joe/configs/
remote_user: joe
priv_key: /root/.ssh/id_ed25519 # Here, the source host's root user's pub key is in remote host's Joe's authorized_keys file
recurse: true
rsync opts: zvjP
"sync to Linda":
source_path: /var/shared/config.json
remote_host: lindas-mac
remote_path: /Users/linda/configs/
remote_user: linda
priv_key: /home/linda/.ssh/id_ed25519 # Here, the source host's Linda pub key is in remote host's (Mac) Linda's authorized_keys file
## all other settings will come from Defaults, ie "recurse" will be set to default "false"
"sync to Default target": # here we will sync source path of /var/shared/config.json to default target of nycweb1 (see Default section above)
source_path: /var/shared/config.json
## this example will rsync any /home directory thats modified, created or deleted to a remote host (host1:/var/homedirs/)
## if a directory or file is deleted, ie localhost:/home/joe/file1, Poni will delete file1 from host1:/var/homedirs/joe/
## BE VERY CAREFUL WITH DELETE PATHS as you can accidentally delete the parent directory on the remote host if not configured correctly!!
## SET "simulate: true" to see what kind of changes will be made on the remote host before running actual rsync (simulate: false)
"sync nested directory":
source_path: /home
remote_host: host1
remote_path: /var/homedirs/
remote_user: root
priv_key: /root/id_rsa
recurse: true
simulate: true