On Tue, Nov 20, 2012 at 1:06 PM, Ugo Bellavance <u...@lubik.ca> wrote:

> However, I would need to push a different file to my NTP servers (the
> puppet://$puppet_server/files/ntp.conf) are for clients.  How can I do that?
> Can I simply declare my two servers in a node declaration and set a variable
> in it and then use a puppet:// path that includes a variable?

The simplest option here is to just do the following, taking your
existing ntp.conf file stanza as an example:

class ntpd {
    package { "ntp":
        ensure => installed,
    }
    file { "/etc/ntp.conf":
      owner => root,
      group => root,
      mode => 0644,
      source => ["puppet://$puppet_server/files/ntp.conf.$host,
                     "puppet://$puppet_server/files/ntp.conf"],
      require => Package["ntp"]
  }

Puppet will use the first file that it finds in the "source" array.
For a more in depth explanation, see the 'source' parameter
description at http://docs.puppetlabs.com/references/3.0.latest/type.html#file.

Hope this helps,

Matt.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
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.

Reply via email to