Ask Your Question
0

Queries about nodes.pp

asked 2015-04-03 04:52:01 -0500

np00330488 gravatar image

updated 2015-04-03 11:00:05 -0500

GregLarkin gravatar image

Hi All, Greetings. Here is a query which is bugging me. With initials attempts to learn puppet manifests I tried following and got stuck here.

pwd /etc/puppetlabs/puppet/environments/production/manifests

nodes.pp

node default{

}
node 'newclient.localdomain'{

include user-centos
package {'telnet':
        ensure =>present,
}

user {'pandey':

ensure=>'absent',
comment =>'pandey',
home =>'/home/pandey',
managehome => true,
password =>'$6$qErfN4qYNjApNR6X$cWypOntx9xYoTA5B6lvHbAT0AvEIao4ItC5iwFfVjqvNJTreKKix9We5DIqxkDdGyMHojDmAcv6kJ.eD4FJ7Z0',
}
}

node "client2.localdomain"{

file {"local.repo":

path => "/etc/yum.repos.d/local.repo",
ensure => present,
owner =>"root",
group =>"root",
content =>"[local]
name=Localrepo
baseurl=ftp://192.168.147.141/pub/localrepo
gpgcheck=0
enabled=1",

}
}

the moment i validate nodes.pp with 'puppet apply validate nodes.pp' i get this error

Error: Could not parse for environment production: Classes, definitions, and nodes may only appear at toplevel or inside other classes at /etc/puppetlabs/puppet/environments/production/manifests/nodes.pp:20

I am very new to puppet so don't know much how to declare classes and modules, so just tried this way. my puppet version is 3.7.4 (Puppet Enterprise 3.7.2) Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-04-05 01:49:59 -0500

Hi,

I assume you meant 'puppet parser validate nodes.pp'?

Are you sure the manifest you posted is the same that gave this error?

When I run 'puppet parser validate nodes.pp' with your posted manifest it validates... without issues.(Puppet version 3.7.3)

Br, Michael

edit flag offensive delete link more

Comments

Apology...yes it is puppet parser validate nodes.pp..and this gives the same error. Tried many times.

np00330488 gravatar imagenp00330488 ( 2015-04-06 00:34:09 -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

1 follower

Stats

Asked: 2015-04-03 04:52:01 -0500

Seen: 2,100 times

Last updated: Apr 05 '15