Re: [Puppet Users] Puppet not picking up files

53 views
Skip to first unread message

Ryan Coleman

unread,
Oct 15, 2012, 5:07:35 PM10/15/12
to puppet...@googlegroups.com


On Mon, Oct 15, 2012 at 1:58 PM, Dan <dan....@gmail.com> wrote:
#       source   => "puppet:///modules/ntp/files/${conf_file}",
        source   => "/etc/puppet/modules/ntp/files/${conf_file}",

It's these lines. What you want to do is specify where the configuration file exists on the puppet master using a syntax like this:

"puppet://<optional puppet master>/modules/<module name>/<configuration file in files directory>",

Try: source => "puppet:///modules/ntp/${conf_file}",

Puppet assumes the files directory so it was looking for /etc/puppet/modules/ntp/files/files/ntp.conf

Dan

unread,
Oct 15, 2012, 6:28:27 PM10/15/12
to puppet...@googlegroups.com
You're a start. Many thanks for that.

Much appreciated.

Dan

On Monday, October 15, 2012 9:58:14 PM UTC+1, Dan wrote:
Hi

I largely copied the example in http://docs.puppetlabs.com/learning/modules1.html. But I'm getting an error when running the following from the client:

puppet agent --server puppetmaster --waitforcert 60 --test
err: /Stage[main]/Ntp/File[ntp.conf]: Could not evaluate: Could not retrieve information from environment production source(s) file:/etc/puppet/modules/ntp/files/ntp.conf at /etc/puppet/modules/ntp/manifests/init.pp:28

on the puppet server I have the following:

# init.pp

    class ntp {
      case $operatingsystem {
        sles: {
          $service_name = 'ntpd'
          $conf_file    = 'ntp.conf'
        }
      }

#      package { 'ntp':
#        ensure => installed,
#      }

      service { 'ntp':
        name      => $service_name,
        ensure    => running,
        enable    => true,
        subscribe => File['ntp.conf'],
      }

      file { 'ntp.conf':
        path    => '/etc/ntp/ntp.conf',
        ensure  => file,
#        require => Package['ntp'],

#       source   => "puppet:///modules/ntp/files/${conf_file}",
        source   => "/etc/puppet/modules/ntp/files/${conf_file}",
      }
    }


Furhter info from puppet server:

puppet apply --configprint:
/etc/puppet/modules:/usr/share/puppet/modules
pluginsource = puppet://puppet/plugins
pluginsync = false


Can someone please help me please, as I'm lost with this error?

Thanks in advance
Dan


Reply all
Reply to author
Forward
0 new messages