@@ -92,39 +92,50 @@ const os = require('os')
92
92
93
93
const targetRoot = os.homedir()
94
94
95
- const unlinks = [{
96
- src: 'old.conf'
97
- }]
98
-
99
- const directories = [{
100
- src: '.config/envs'
101
- }, {
102
- src: 'vim',
103
- dst: '.vim'
104
- }, {
105
- src: 'private',
106
- dmode: '0700',
107
- fmode: '0600',
108
- user: 'root',
109
- group: 'wheel'
110
- }]
111
-
112
- const files = [{
113
- src: '.zshrc'
114
- }, {
115
- src: `keys/${os.hostname()}`,
116
- dst: '.ssh/id_rsa',
117
- fmode: '0600',
118
- pkgs: ['openssh']
119
- }]
120
-
121
- const symlinks = [{
122
- src: '.config/env.conf',
123
- dst: '.config/envs.${os.hostname()}.conf',
124
- hosts: ['alpha', 'delta']
125
- }]
126
-
127
- module.exports = {targetRoot, unlinks, directories, files, symlinks}
95
+ const unlinks = [
96
+ {
97
+ src: 'old.conf'
98
+ }
99
+ ]
100
+
101
+ const directories = [
102
+ {
103
+ src: '.config/envs'
104
+ },
105
+ {
106
+ src: 'vim',
107
+ dst: '.vim'
108
+ },
109
+ {
110
+ src: 'private',
111
+ dmode: '0700',
112
+ fmode: '0600',
113
+ user: 'root',
114
+ group: 'wheel'
115
+ }
116
+ ]
117
+
118
+ const files = [
119
+ {
120
+ src: '.zshrc'
121
+ },
122
+ {
123
+ src: `keys/${os.hostname()}`,
124
+ dst: '.ssh/id_rsa',
125
+ fmode: '0600',
126
+ pkgs: ['openssh']
127
+ }
128
+ ]
129
+
130
+ const symlinks = [
131
+ {
132
+ src: '.config/env.conf',
133
+ dst: '.config/envs.${os.hostname()}.conf',
134
+ hosts: ['alpha', 'delta']
135
+ }
136
+ ]
137
+
138
+ module.exports = { targetRoot, unlinks, directories, files, symlinks }
128
139
```
129
140
130
141
#### Complete manifest API
@@ -207,15 +218,18 @@ const defaults = {
207
218
*
208
219
* The src is relative to the global targetRoot option.
209
220
*/
210
- const unlinks = [{
211
- // Remove ~/intruders on all hosts.
212
- src: ' intruders'
213
- }, {
214
- // Remove ~/warpcore on host enterprise, if the eject package is installed.
215
- src: ' warpcore' ,
216
- hosts: [' enterprise' ],
217
- pkgs: [' eject' ]
218
- }]
221
+ const unlinks = [
222
+ {
223
+ // Remove ~/intruders on all hosts.
224
+ src: ' intruders'
225
+ },
226
+ {
227
+ // Remove ~/warpcore on host enterprise, if the eject package is installed.
228
+ src: ' warpcore' ,
229
+ hosts: [' enterprise' ],
230
+ pkgs: [' eject' ]
231
+ }
232
+ ]
219
233
220
234
/* Synchronize the contents of the directory at src to dst
221
235
* and sets the directory and file permissions.
@@ -227,36 +241,42 @@ const unlinks = [{
227
241
*
228
242
* If dst is not given, will use src as the subpath.
229
243
*/
230
- const directories = [{
231
- // Synchronize ./holodeck to ~/holodeck on all hosts.
232
- src: ' holodeck'
233
- }, {
234
- // Synchronize ./panels/exploding to ~/bridge/panels
235
- // on hosts enterprise and defiant,
236
- // if the turbolift and transporter packages are installed,
237
- // and set specific user, group, and access permissions.
238
- src: ' panels/exploding' ,
239
- dst: ' bridge/panels' ,
240
- user: ' numberone' ,
241
- group: ' officers' ,
242
- dmode: ' 0755' ,
243
- fmode: ' 0644' ,
244
- hosts: [' enterprise' , ' defiant' ],
245
- pkgs: [' turbolift' , ' transporter' ]
246
- }, {
247
- // Install sickbay first, then install the beds and meds.
248
- src: ' decks/sickbay' ,
249
- dst: ' sickbay' ,
250
- order: 10
251
- }, {
252
- src: ' beds' ,
253
- dst: ' sickbay/beds' ,
254
- order: 11
255
- }, {
256
- src: ' meds' ,
257
- dst: ' sickbay/meds' ,
258
- order: 11
259
- }]
244
+ const directories = [
245
+ {
246
+ // Synchronize ./holodeck to ~/holodeck on all hosts.
247
+ src: ' holodeck'
248
+ },
249
+ {
250
+ // Synchronize ./panels/exploding to ~/bridge/panels
251
+ // on hosts enterprise and defiant,
252
+ // if the turbolift and transporter packages are installed,
253
+ // and set specific user, group, and access permissions.
254
+ src: ' panels/exploding' ,
255
+ dst: ' bridge/panels' ,
256
+ user: ' numberone' ,
257
+ group: ' officers' ,
258
+ dmode: ' 0755' ,
259
+ fmode: ' 0644' ,
260
+ hosts: [' enterprise' , ' defiant' ],
261
+ pkgs: [' turbolift' , ' transporter' ]
262
+ },
263
+ {
264
+ // Install sickbay first, then install the beds and meds.
265
+ src: ' decks/sickbay' ,
266
+ dst: ' sickbay' ,
267
+ order: 10
268
+ },
269
+ {
270
+ src: ' beds' ,
271
+ dst: ' sickbay/beds' ,
272
+ order: 11
273
+ },
274
+ {
275
+ src: ' meds' ,
276
+ dst: ' sickbay/meds' ,
277
+ order: 11
278
+ }
279
+ ]
260
280
261
281
/* Copy the file at src to dst
262
282
* and sets the file permissions.
@@ -268,40 +288,46 @@ const directories = [{
268
288
*
269
289
* If dst is not given, will use src as the subpath.
270
290
*/
271
- const files = [{
272
- // Copy ./bay/torpedo to ~/bay/torpedo on all hosts.
273
- src: ' bay/torpedo'
274
- }, {
275
- // Copy ./phaser to ~/brig/phaser
276
- // on host defiant, if the stun package is installed,
277
- // and set the user, group, and access permissions.
278
- src: ' phaser' ,
279
- dst: ' brig/phaser' ,
280
- user: ' warf' ,
281
- group: ' security' ,
282
- fmode: ' 0600' ,
283
- hosts: [' defiant' ],
284
- pkgs: [' stun' ]
285
- }]
291
+ const files = [
292
+ {
293
+ // Copy ./bay/torpedo to ~/bay/torpedo on all hosts.
294
+ src: ' bay/torpedo'
295
+ },
296
+ {
297
+ // Copy ./phaser to ~/brig/phaser
298
+ // on host defiant, if the stun package is installed,
299
+ // and set the user, group, and access permissions.
300
+ src: ' phaser' ,
301
+ dst: ' brig/phaser' ,
302
+ user: ' warf' ,
303
+ group: ' security' ,
304
+ fmode: ' 0600' ,
305
+ hosts: [' defiant' ],
306
+ pkgs: [' stun' ]
307
+ }
308
+ ]
286
309
287
310
/* Create a system link (symlink) at src pointing to dst.
288
311
*
289
312
* The src and dst are relative to the global targetRoot option.
290
313
*
291
314
* NOTE: this WILL replace the file at src.
292
315
*/
293
- const symlinks = [{
294
- // Create a symlink from ~/drink to ~/tea/earlgray/hot on all hosts.
295
- src: ' drink' ,
296
- dst: ' tea/earlgray/hot'
297
- }, {
298
- // Create a symlink from ~/hypospray to ~/hyposprays/norepinephrine
299
- // on host enterprise if the sickbay package is installed.
300
- src: ' hypospray' ,
301
- dst: ' hyposprays/norepinephrine' ,
302
- hosts: [' enterprise' ],
303
- pkgs: [' sickbay' ]
304
- }]
316
+ const symlinks = [
317
+ {
318
+ // Create a symlink from ~/drink to ~/tea/earlgray/hot on all hosts.
319
+ src: ' drink' ,
320
+ dst: ' tea/earlgray/hot'
321
+ },
322
+ {
323
+ // Create a symlink from ~/hypospray to ~/hyposprays/norepinephrine
324
+ // on host enterprise if the sickbay package is installed.
325
+ src: ' hypospray' ,
326
+ dst: ' hyposprays/norepinephrine' ,
327
+ hosts: [' enterprise' ],
328
+ pkgs: [' sickbay' ]
329
+ }
330
+ ]
305
331
306
332
/* Export each value set above.
307
333
* The export may be a plain object as below, or a function, promise,
0 commit comments