On Thursday, January 16, 2014 9:35:49 AM UTC-6, jyotir bhandari wrote:
>
> Hi John
>
> I just configured as you guided
>
> [root@server manifests]# tree
> .
> |-- account
> |   `-- account.pp
> |-- packages
> |   |-- ec2.pp
> |   |-- elinks.pp
> |   `-- nmap.pp
> `-- site.pp
>
> *accout.pp*
>
> class user::add{
> user { 'demo':
>        ensure => present,
>        comment => 'demo user',
>        home => '/home/demo',
>        managehome => true,
>      }
> }
>
> *site.pp*
>
>
>
> node 'client2.puppet.com' {
>     import 'packages/nmap.pp'
>     import 'packages/elinks.pp'
>     import 'packages/ec2.pp'
>     import 'account/account.pp'
>     include 'user::add'
>     }
>
>>
>> I recommended the class puppet::master not user::add, but you are not 
using puppet manifests in the way they are intended.

Your code should be in modules.  You include these pieces of code not 
import them in your site.pp file.

You can read more about import and best practices here:
http://docs.puppetlabs.com/puppet/latest/reference/lang_import.html


Your tree should look like this:

manifests/site.pp
modules/puppet/manifests/init.pp
modules/puppet/manifests/master.pp

In modules/puppet/manifests/init.pp you will define the class puppet.  In 
modules/puppet/manifests/master.pp you will define the class puppet::master 
as so:

class puppet::master {
 user {‘demo’:
     ensure => present,
  }
}

The reason I suggest the puppet::master is you may want to have some common 
code relevant to all sytems running puppet in the puppet class.  Using the 
master class allows you to seperate code that you only want to go on your 
master.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/93b973a5-9d62-4295-9464-8f7fa9a6fe8f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to