Distributing file over puppet client

878 views
Skip to first unread message

niraj

unread,
Mar 7, 2012, 4:39:33 AM3/7/12
to Puppet Users
Hi All,
I am very new to puppet and would like to know how to
distribute some files to all the puppet client.

i used the following to do my task.
edited the site.pp file to below.

class sudo {
file { "/etc/sudoers":
owner => root,
group => root,
mode => 440,
source => "puppet://rover.test.com/files/etc/sudoers"
}
}

node 'client1.test.com' {
include sudo
}


But i get an error somewhat like this:-

Error 400 on server: Permission denied


Please help me on this or any other method to copy files to puppet
cliend

Bernd Adamowicz

unread,
Mar 7, 2012, 5:39:04 AM3/7/12
to puppet...@googlegroups.com
That's basically OK, but try

source => "puppet:///files/etc/sudoers"

instead. This will link automatically to your local host's Puppet master. If you are already working with modules, you should work with

source => "puppet:///modules/<yourmodulename>/etc/sudoers"

Your file 'sudoers' must then be below a directory 'etc' in your 'files' directory in the according module.

Bernd

> -----Ursprüngliche Nachricht-----
> Von: puppet...@googlegroups.com [mailto:puppet-
> us...@googlegroups.com] Im Auftrag von niraj
> Gesendet: Mittwoch, 7. März 2012 10:40
> An: Puppet Users
> Betreff: [Puppet Users] Distributing file over puppet client

> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-
> users+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

niraj

unread,
Mar 7, 2012, 6:14:18 AM3/7/12
to Puppet Users
Hi Bernd,
I get the following error on doing what you said.


root@client1:~# puppet agent --test --server='rover.test.com'
info: Caching catalog for client1.test.com
info: Applying configuration version '1331112706'
err: /Stage[main]/Sudo/File[/etc/sudoers]: Could not evaluate: Error
400 on SERVER: Permission denied - /etc/puppet/files/etc/sudoers Could
not retrieve file metadata for puppet:///files/etc/sudoers: Error 400
on SERVER: Permission denied - /etc/puppet/files/etc/sudoers at /etc/
puppet/manifests/site.pp:33
notice: Finished catalog run in 0.47 seconds.


Can you suggest me some steps where i can copy some files to puppet
client from start.??

Thanx
Niraj





On Mar 7, 5:39 am, Bernd Adamowicz <Bernd.Adamow...@esailors.de>
wrote:

Bernd Adamowicz

unread,
Mar 7, 2012, 7:06:27 AM3/7/12
to puppet...@googlegroups.com
Niraj,

I'll give you an example that works for me. But it uses modules. If you don't so far, you really should start.

Given this structure below an environment below '/etc/puppet' on my Puppet master:

.
├── manifests
├── modules
│   ├── backup
│   │   ├── files
│   │   └── manifests
│   ├── exim
│   │   ├── manifests
│   │   └── templates
...

Now for copying a file named 'backup-key.dss' to the clients, this file must be below 'modules/backup/files'. And the source attribute will look like this:

source => "puppet:///modules/backup/backup-key.dss",

So you may simply want to check your paths.

If this does not work, you should provide your manifest and your directory structure.

Cheers,
Bernd

> -----Ursprüngliche Nachricht-----
> Von: puppet...@googlegroups.com [mailto:puppet-
> us...@googlegroups.com] Im Auftrag von niraj
> Gesendet: Mittwoch, 7. März 2012 12:14
> An: Puppet Users
> Betreff: [Puppet Users] Re: Distributing file over puppet client

Iain Sutton

unread,
Mar 7, 2012, 8:25:57 PM3/7/12
to puppet...@googlegroups.com
Is the source file readable by the puppet user?

To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages