HI, Le jeudi 6 décembre 2012 13:07:19 UTC+1, mawi a écrit : > > Hi, > > I'm looking for help on this use case: > > I have several modules managing e.g. ntp and ssh on some nodes. The > content of ntp.conf and sshd_config are generated from templates for most > of the nodes. Now we have a use case where some nodes need specific > sshd_config or other admins need to make permanent local edits to those > files or even provide their own sshd_config. > > How can I select between source and template for file resouces and how do > I organize this in my VCS? > > Snippet from ssh module => > > file { > $config : > ensure => file, > owner => 0, > group => 0, > mode => 0600, > content => template("${module_name}/${config_tpl}"), > require => Package[$pkg_name], > notify => Service[$svc_name] > } > > How can I incorporate a selector that checks for a source first on the > fileserver? and defaults to the sshd_config template? > you may want take a look at hiera.
> > if > source => "puppet://private/${module_name}/file/sshd_config > else > content => template("${module_name}/${config_tpl}") > end > however be aware, using something like $module_name in hiera.yaml won't work as expected, at least in my experience. evelio -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/LXRhCghCx1cJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.