Re: [Puppet Users] Re: Role-based puppet

2013-10-29 Thread Chad Huneycutt
In that example, 'role' is a module, and 'role::somerole' is a class
in that module:

/etc/puppet/modules/role/manifests/somerole.pp:

class role::somerole {
...
}

- Chad

On Sat, Oct 26, 2013 at 7:58 AM, Steven Jonthen
coffeejunkeyst...@gmail.com wrote:
 I've a question:
 What does this mean/how is this realized?:
 '::role::somerole'

 Is this a module or a manifest? What is role and what somerole? How does
 the content look like and where do I have to create it?
 Can you give me an example?

 --
 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 puppet-users+unsubscr...@googlegroups.com.
 To post to this group, send email to puppet-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/puppet-users.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
Chad M. Huneycutt

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAOJfo155Fy6L3083ppdtTnbKyFPc1_FaCZR71oiBXjB3XrxiQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Role-based puppet

2013-10-26 Thread Steven Jonthen
Ok thanks!

That helps me a lot! I'll do research on your hints and come back if I've 
questions. 

Thanks a lot!

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Role-based puppet

2013-10-26 Thread Steven Jonthen
I've a question: 
What does this mean/how is this realized?:
'::role::somerole'

Is this a module or a manifest? What is role and what somerole? How 
does the content look like and where do I have to create it?
Can you give me an example?

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Role-based puppet

2013-10-25 Thread Daniele Sluijters
Hi,

What you'll need is some way to classify nodes, I do this through Hiera.

Per node I have a yaml file named after the host: hostname.yaml with the 
following:
---
roles:
  - '::role::somerole'

In manifests/site.pp I only define one node, the default:
node default {
  hiera_include('roles', [])
}

Now when hostname checks in it will hit node default and a hiera lookup 
will be done for an array named 'roles', which I just defined in the yaml 
file. If it's found those roles, which are actually a puppet module, are 
included on the host/in the catalog and get applied. If not we return an 
empty array so nothing happens, you can also chose not to provide a default 
in which case it will error.

As for how to organise roles and profile in Puppet, Craig Dunn has a very 
nice post that should get you started:
http://www.craigdunn.org/2012/05/239/

-- 
Daniele Sluijters

On Friday, 25 October 2013 19:08:39 UTC+2, Steven Jonthen wrote:

 Hi guys,

 I want realise a role-based puppet-configuration. What I mean is this:
 There should be a simple external text-file, which contains hostname/node 
 -- role association. 
 Then there should be a class-definition for each role. In this way, I want 
 to associate a server with different roles. 
 In this way, Puppet should look for the hostname of the Puppet-Agent in 
 the external file and see what roles it should have and then 
 execute the role-classes. 

 I hope I could explain my problem. The problem is, that I've no idea how 
 to realise it. 
 Please help


-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.