2

I have a very basic question regarding to Puppet 3.0.1 configuration.

I setup a puppet master server (CentOS) with 2 agents (CentOS and Windows 7), all 3 can ping and access each other. There is no error at all.

I have copied a file under /etc/puppet/files/test2.txt

my /etc/puppet/manifests/site.pp contains these lines:

node default {
    file { "/tmp/testmaster.txt":
      owner => root,
      group => root,
      mode => 644,
      source => "puppet:///files/test2.txt"
    }
}

but there will no file be created on agent servers under /tmp/ once I run puppet agent --test

here is the output:

[root@agent1 ~]# puppet agent --test
Info: Retrieving plugin
Info: Caching catalog for agent1.mydomain.com
Info: Applying configuration version '1354267916'
Finished catalog run in 0.02 seconds

puppet apply /etc/puppet/manifests/site.pp creates the testmaster.txt under /tmp/ on master.

  • 2
    Not sure if it's of any help, but I suggest adding ensure => present in the file definition. – gertvdijk Nov 30 '12 at 9:52
  • 1
    I'd also try running the master as puppet master --no-daemonize --debug and see what's going on there. – growse Nov 30 '12 at 12:06
  • You don't have any classes defined? I'm not sure this works. What are the client side contents of /var/lib/puppet/state/classes.txt /var/lib/puppet/state/resources.txt ? I would suggest just having one line like node default { include myclass } Use puppet module generate myclass to create the class directory structure. Then move the file section in the init.pp file which the generate command just created. Alternatively, you can have one line in the node section like above, but create the class inside site.pp, like shown here: debian-administration.org/articles/526 – Not Now Nov 30 '12 at 23:40
0

OK I think you should try and run the following command on your client

puppet agent --test --server=puppetmaster.domain.com

  • sorry, but none of both suggestions has worked. I'm really perplexed. – nicmon Nov 30 '12 at 11:07
0

Can your puppet clients connect to the puppet master via the puppet master's port (usually 8140)?

You could check this from the puppet client:

telnet puppetmaster 8140

Did your puppet master sign the certificate request from your puppet clients?

Check this from the puppet master:

puppetca -l
0

I think you need to specify the puppet file server in your configuration:

node default {
    file { "/tmp/testmaster.txt":
      owner => root,
      group => root,
      mode => 644,
      source => "puppet://puppetmaster.domain.com/files/test2.txt"
    }
}
  • shall I perhaps trigger a refresh and load of site.pp to inform agents ? (no idea how) – nicmon Nov 30 '12 at 15:17
  • This is not correct, you can omit the puppet master name, but you must have the module path in the source URL. – robbyt Dec 2 '12 at 16:47
  • Is this new? I did like that the last time I used puppet, 6 months ago. – Christophe Drevet-Droguet Dec 3 '12 at 9:18
0

You need to specify the modules folder in your source path. This is a new requirement for puppet 3.0.

file{'/my-file':
  ensure => file,
  source => 'puppet:///modules/my_module/my-file',
}
0

wow, the problem was a missspelled filename, my site.pp was named (somehow) side.pp, renamed the file and everything works again. this proofs that I sould not simply copy & paste stuffs from unauthorized tutorials.

Thank everybody to deal with my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.