Ask Your Question

Where do I put "source" files on the master so puppet will install them on nodes using Hiera?

asked 2014-05-25 15:27:20 -0500

zogman gravatar image

I know puppet modules always have a files directory and I know where it's supposed to be and I have used the source => PATH to file syntax effectively in my own, handwritten modules but now I need to learn how to deploy files like sudoers using Hiera.

I'm starting with the saz-sudo module and I've read the docs but I can't see anything about where to put the sudoers file; the one I want to distribute. I'm not sure whether I need to set up a site-wide files dir in /etc/puppetlabs/puppet and then make subdirs in there for every module or what. And does Hiera know to look in /etc/puppetlabs/puppet/files/sudo if I say, source => "puppet:///files/etc/sudoers" ? Do I need to add a pathname in /etc/hiera.yaml? Add a line - files ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-05-27 08:57:40 -0500

gh gravatar image

You can serve data from custom mount points as opposed to only serving them from a module. Though the fact that you feel that you need to do this suggests that you would be better off using a template for the file serving.

edit flag offensive delete link more

answered 2014-06-07 14:45:37 -0500

updated 2014-06-07 14:47:51 -0500

The saz-sudo module has two parameters which decide which file to use and whether to use it.

 class sudo(
   $config_file_replace = true,
   $source = $sudo::params::source
 ) inherits sudo::params {

Your hiera should look something like this:

 sudo::source: 'puppet:///modules/sudo/etc/sudoers'

Assuming that the filename is /etc/puppetlabs/puppet/modules/sudo/files/etc/suoders and assuming that the sudo class is included for the node

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-05-25 15:27:20 -0500

Seen: 401 times

Last updated: Jun 07 '14