Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 75

2 users 1 template

$
0
0
I have a module which defines a few users, each of whom have slightly different needs (e.g., home directory, uid, gid, groups, etc.). I'll use netatalk as an example, since we're using it for server-based Time Machine backups. Netatalk requires a file called `/etc/netatalk/AppleVolumes.default`, which should have an entry for each of the defined users, like so: # AppleVolumes.default - Managed by Puppet - DO NOT EDIT BY HAND :DEFAULT: options:upriv,usedots /home/john/timemachine "John's TM on foo" options:tm allow:john allowed_hosts:192.168.1.1/24 /home/jane/timemachine "Jane's TM on foo" options:tm allow:jane allowed_hosts:192.168.1.1/24 Now, with one user, I can use `template()` to create John's entry in the `AppleVolumes.default`. But if I do the same thing with Jane's manifest, it would (I assume) overwrite the file with Jane's copy. How can I merge both users into the same file gracefully?

Viewing all articles
Browse latest Browse all 75

Trending Articles