Ask Your Question
0

puppet manifest does not seem to be replicated on client.

asked 2015-03-29 07:37:28 -0500

np00330488 gravatar image

updated 2015-03-29 14:34:03 -0500

csharpsteen gravatar image

Hi, I am new to puppet...I have installed puppet on two machines 1. Master : hostname : master os :centos 6.5 puppet version: 3.7.4 (Puppet Enterprise 3.7.2)

2.client. hostname : newclient os :centos 6.5 puppet version: 3.7.4 (Puppet Enterprise 3.7.2)

Manifest details /etc/puppetlabs/puppet/manifests/site.pp

node "newclient" {

  file { "/root/helloworld.txt":
    ensure => file,
    owner  => "root",
    group  => "root",
    mode   => 0644
  }

}

After creating this manifest I run the following command in client but nothing works out

sudo puppet agent --verbose --no-daemonize --onetime
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for newclient.localdomain
Info: Applying configuration version '1427054941'
Notice: Finished catalog run in 0.02 seconds

..Please Help

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-03-29 16:54:47 -0500

lavaman gravatar image

The answer is in your agent output. You've defined the file for an node named 'newclient', but as you can see in the output, your node's name is actually 'newclient.localdomain'

edit flag offensive delete link more

Comments

please have a look at new answer, as comment has a limitation of words.

np00330488 gravatar imagenp00330488 ( 2015-03-30 02:45:14 -0500 )edit
0

answered 2015-03-30 02:44:08 -0500

np00330488 gravatar image

I tried with this name as well. After following puppet document at https://docs.puppetlabs.com/pe/latest...starthelloworld.html this solution works fine but this time the location is '/etc/puppetlabs/puppet/environments/production/modules/testing/manifests'

here I have teo files

  1. init.pp

cat init.pp include test

2.test.pp

class testing::test{

user { 'ironman': ensure => 'present', comment => 'again by puppet', gid => '0', home => '/home/ironman', password => '$6$JzWFXB.4/BaSILCJ$6UqQP6IzEb92BwO5cN0tXqkb7LXgNFVOrRQYvKrFe.7NDYQ0J2.Y0C0.5peTMPGBjUblewL6pUs5Aa/19XQUQ0', passwordmaxage => '99999', passwordminage => '0', shell => '/bin/bash', uid => '1112', } }

and I am adding this module to the group 'default' from web page. and this time it works.

but nothing happens in the previous case where I create a site.pp file with following content

node "newclient.localdomain" {

file { "/root/helloworld.txt": ensure => file, owner => "root", group => "root", mode => 0644, content => "yahooooo", }

}

however the above code executes on master server with 'puppet apply site.pp' but on the client output is same... Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Info: Caching catalog for newclient.localdomain Info: Applying configuration version '1427096942' Notice: Finished catalog run in 0.37 seconds

and file does not get created after.

edit flag offensive delete link more

Comments

If you're using console, I don't think it will use a node definition in site.pp. You need to put all your code into modules and use the console to add them to a server, or include them in a class that is getting added to a server.

lavaman gravatar imagelavaman ( 2015-04-03 16:59:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-03-29 07:37:28 -0500

Seen: 268 times

Last updated: Mar 30 '15