Startup help puppet

12 views
Skip to first unread message

Wiesel82

unread,
Dec 8, 2011, 5:45:04 AM12/8/11
to Puppet Users
Hi all,
i started this week to install puppet. Everything runs fine in this
part.
The client is authenticated with the master and i find them if i start
the command

puppet cert --list --all

I created my first pp-files and my first module.
if test all with puppet apply it works.

I wrote a module which copy a file to a other place (/etc/puppet/
modules/test/files/test.txt to /test/test.txt).
If i test this with puppet apply the file will be copied to this
directory..

But now i would like to do this in a authenticated client.

I read that i need to create the fileserver.conf and change the url
to

source => 'puppet:///test/files/test.txt',

Firstly i test it with default node in a second test i created a
second node (fqdn) and copied the same content inside.

node default {
notice("Hallo OSMC")
include test
}
node test.vm {
notice("Hallo OSMC")
include test
}

What should i do, that the client get this file from the master?

Best regards

Wiesel

Mohamed Lrhazi

unread,
Dec 8, 2011, 1:10:29 PM12/8/11
to puppet...@googlegroups.com
On the client, run puppet agent --test --trace --debug
That would show you what the puppet client is doing....

If you still have problems:

in "include test" what is test? a module? show the full content of it.

I personally use modules for everything and I always have the files
distributed at the module level, like:

source => "puppet:///modules/gu_auth/foo.ext",

where gu_auth is the name of a module.


Thanks,
Mohamed,

> --
> 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...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>

Wiesel82

unread,
Dec 9, 2011, 5:15:10 AM12/9/11
to Puppet Users
Hi Mohamaed,
i find the problem. I needed to create a subdirectory in the root-
directory of the fileserver. After this my test.txt was sent to the
client.

I started directly with modules.
In the second way i planned to modify my sshd_config on the client.

If i do this i get on every time this message

err: /Stage[main]/Ssh/File[/etc/ssh/sshd_configtest]: Could not
evaluate: Could not retrieve information from source(s) puppet:///ssh/sshd_config
at /etc/puppet/modules/ssh/manifests/init.pp:12

It only works if i change the source path to puppet:///test/test.txt
If i create a only a new directory ssh where the the directory test is
i think i need to change only puppet:///test/test.txt to puppet:///ssh/sshd_config.
But i get the error message and also is i copy the file in the test
directory or copy the test.txt to the ssh directory. Did i forgot
something? Cache?

fileserver.conf

[configuration]
path /etc/puppet/manifests/files
allow *

i changed only this part in auth.conf

path /etc/puppet/manifests/files
allow *

ls -l /etc/puppet/manifests/files/ssh/sshd_config
-rw-r--r-- 1 root root 9 9. Dez 10:53 /etc/puppet/manifests/files/ssh/
sshd_config

cat /etc/puppet/modules/ssh/manifests/init.pp

class ssh {
package { 'ssh':
name => ['openssh'],
ensure => latest
}

file {'/etc/ssh/sshd_configtest':
ensure => file,
source => 'puppet:///ssh/sshd_config',
require => Package['ssh'],
}

service { 'ssh':
ensure => stopped,
hasstatus => true,
hasrestart => true,
enable => true,
}
}

If i change only the directory to my test.txt it runs without errors

ls -l /etc/puppet/manifests/files/test/test.txt
-rw-r--r-- 1 root root 10 7. Dez 11:14 /etc/puppet/manifests/files/
test/test.txt

cat /etc/puppet/manifests/files/test/test.txt
test-file

What's wrong???

Thx

Wiesel

On 8 Dez., 19:10, Mohamed Lrhazi <lrh...@gmail.com> wrote:
> On the client, run puppet agent --test --trace --debug
> That would show you what the puppet client is doing....
>
> If you still have problems:
>
> in "include test" what is test? a module?  show the full content of it.
>
> I personally use modules for everything and I always have the files
> distributed at the module level, like:
>
> source  => "puppet:///modules/gu_auth/foo.ext",
>
> where gu_auth is the name of a module.
>
> Thanks,
> Mohamed,
>

Nicolai

unread,
Dec 9, 2011, 6:26:31 AM12/9/11
to puppet...@googlegroups.com
Hi

Please read the basic documentation on modules: http://docs.puppetlabs.com/guides/modules.html

It states that a module should have the following structure:

MODULE_PATH/ └──downcased_module_name/ ├──files/ ├──manifests/ │ ├──init.pp │ └──foo.pp ├──lib/ │ ├──puppet/ │ │ ├──parser/ │ │ │ └──functions/ │ │ ├──provider/ │ │ └──type/ │ └──facter/ ├──templates/ ├──tests │ ├──init.pp │ └──foo.pp └──README

Notice the files-directory, this is were you put all files that belongs to this module that you want to pull with the file-resourcetype.

So your source in your ssh-module should be: source => puppet:///modules/ssh/whatever_file_you want.

Regards

Nicolai

Wiesel82

unread,
Dec 9, 2011, 8:55:49 AM12/9/11
to Puppet Users
Thx Nicolai,
i remeber me that i read it but after many problems i forgot it.

My sshd_config needed to change the user to user puppet. If i don't do
it puppetmaster have no access and put out an error 400, to send this
file to the client.

Thx
Wiesel

Reply all
Reply to author
Forward
0 new messages