Re: [Puppet Users] puppet not copying config file

143 views
Skip to first unread message

Brian Mathis

unread,
Jan 18, 2013, 12:21:57 AM1/18/13
to puppet...@googlegroups.com
Where does the file exist on the filesystem?

This is somewhat counter-intuitive until you do it a few times. The
source path in the manifest is:
puppet:///modules/ntp/ntp.conf
but in the filesystem, the file should be under
modules/ntp/files/ntp.conf

You may have missed the "files" in there on the filesystem. At first
glance the URL is just a straight path, but Puppet treats it more like
a list of arguments that it processes.

Also, you might find clues in the log files on the master, probably in
syslog somewhere.


❧ Brian Mathis


On Thu, Jan 17, 2013 at 7:11 PM, Brigzzy Briggs <bri...@gmail.com> wrote:
> Hi All,
>
> Sorry if this is a really remedial question, but I cannot find the answer to
> my problem anywhere else. I am trying to learn puppet, and am creating a
> basic ntp module, that should install the ntp package (Which it does), then
> copy the ntp.conf file (Which it does not) and then start the service (Which
> it does). Could someone please look at the init.pp file below and tell me
> what I am doing wrong? Is there a line or a parameter that I missed in
> there somewhere?
>
> It is worth noting that both the client and server are Ubuntu 12.10.
>
> Thanks :)
>
> class ntp {
> package { 'ntp':
> ensure => latest,
> }
>
> file { '/etc/ntp.conf':
> ensure => file,
> source => 'puppet:///modules/ntp/ntp.conf',
> owner => root,
> group => root,
> mode => 0444,
> require => Package['ntp'],
> notify => Service['ntp'],
> }
>
> service { 'ntp':
> ensure => 'running',
> enable => 'true',
> }
> }
>
> --
> 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/-/9hPmf0chP2wJ.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

Brigzzy Briggs

unread,
Jan 18, 2013, 12:44:39 AM1/18/13
to puppet...@googlegroups.com
Thanks for the reply :)  I got it to work by adding a path to the fileserver.conf file as follows:  path /etc/puppet/files

and put my config file in there, but if I am reading your reply correctly, I can just create a folder called files in /etc/puppet/modules/ntp, and it will be read when the module is loaded, correct?  This way I can keep my config files with their respective modules and not need a separate folder for them?

Thanks so much for your reply :)

Brigzzy

Ellison Marks

unread,
Jan 18, 2013, 12:16:35 PM1/18/13
to puppet...@googlegroups.com
Correct. When you use that syntax in the source parameter, it looks for the file specified, in a directory called files, in the module specified.

Brian Mathis

unread,
Jan 18, 2013, 2:43:05 PM1/18/13
to puppet...@googlegroups.com
Yes, I was assuming you were using modules, which I suppose I should
have clarified. As you are just getting started, I would recommend
that you start with modules right away, as they make things easier,
and are also the recommended way to do things.

Here is an overview of modules:
http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html
which the Learning Puppet series also covers:
http://docs.puppetlabs.com/learning/


❧ Brian Mathis
> https://groups.google.com/d/msg/puppet-users/-/9W0iPtFQGTIJ.

Brigzzy Briggs

unread,
Jan 19, 2013, 1:42:42 AM1/19/13
to puppet...@googlegroups.com
Perfect, that did exactly what I was looking for  :)  

Thanks All!
Reply all
Reply to author
Forward
0 new messages