I would like to use puppet to create mailboxes. Basically, I only need a directory to be created when a new user arrives. However, the users list is quite huge and creating a file stanza per user is out of question. I have found a way to pass an array with this stanza:
file { [ "user1", "user2", ... ]:
ensure => directory,
owner => $user,
group => 'mail',
mode => 0660,
}
There are 2 problems with this: First, there is no way to retrieve the users list from an external resource (which could be a CSV file, for instance). And secondly, I can't see how it is possible to instantiate the owner value.
I have thought to define function, but the same problems remains. Has someone found a solution to solve this problem?