On Tue, Mar 1, 2011 at 8:28 PM, Luis Miguel Silva
<[email protected]> wrote:
> Oh k, i just figured out how does Puppet get the node classes from the
> dashboard, it does so by using the external node feature (that someone
> had already talked about in this mailing list)! :o)
>
> I'm just having some trouble understanding how do we specify classes
> via site.pp and how to configure them with individual parameters (via
> both the dashboard and site.pp).
So the organization of puppet should be: node { class { resource } }.
Node correspond with your system, class with service roles, and
resource to discrete resources on your system. Dashboard view is top
down from the node level.
Classes should be specified in modules using the autoloader
convention, so if you have a class foo it should be in module foo or
/etc/puppetlabs/puppet/modules/foo/manifests/init.pp. If this seems a
bit confusing see:
http://docs.puppetlabs.com/guides/modules.html
Continuing our example:
class foo ($var="default") {
notify { $var: }
}
Parametrized classes are new in Puppet 2.6. Support for parametrized
classes via ENC was introduced in 2.6.5. Support for parametrized
classes in dashboard is on the road map.
Currently here's the way to declare parametrized classes in site.pp:
node node01 {
class { foo:
var => "hello world!",
}
}
To support parametrized class in dashboard, I write a wrapper class
(necessary until Dashboard fully supports parametrized classes):
class foo::wrapper {
class { foo:
var => $::foo_var,
}
}
In this case assign class foo::wrapper to node1 in dashboard and
configure the parameter foo_var="hello world!".
HTH,
Nan
> Thanks!
> Luis
>
> On Tue, Mar 1, 2011 at 8:12 PM, Luis Miguel Silva
> <[email protected]> wrote:
>> Nan,
>>
>> I'm really confused here. Thanks to your tips, i was able to download
>> an extra-module (i tried downloading puppetlabs/apache and
>> bob-iptables) but i'm not entirely sure how to use them.
>>
>> I first tried adding a class called "helloworld" via dashboard and
>> associated it with one of my nodes (which worked perfectly).
>> I then tried doing the same thing by creating a
>> /etc/puppetlabs/puppet/manifests/site.pp file with:
>> node node01 {
>> include helloworld
>> }
>>
>> But that did not seem to work.
>> I tried restarting pe-puppet on both the client and the server but had
>> no success...
>>
>> So, right now, i'm able to define new classes via the dashboard, but
>> not via site.pp (and could not find out exactly how does the dashboard
>> add classes to nodes, i did a grep for the node name in
>> /etc/puppetlabs/ and could not find anything...).
>>
>> Finally, although adding classes to nodes via the dashboard works just
>> fine, how do i specify the extra arguments?
>> For instance, looking at the bob/iptables module you pointed out, it
>> ships with a README.rst that shows a sample config:
>> iptables { "001 allow icmp":
>> proto => "icmp",
>> icmp => "any",
>> jump => "ACCEPT",
>> }
>>
>> But where do i specify this in the dashboard? (specific class parameters)?
>> And how do i configure it in a site.pp ?
>>
>> That's the only two questions i have (and i promise not to bother you
>> anymore)! :o)
>>
>> Thanks a lot for your help,
>> Luis
>>
>> On Tue, Mar 1, 2011 at 6:14 PM, Luis Miguel Silva
>> <[email protected]> wrote:
>>> Oh, awesome!
>>> My path env var didnt include that path so i couldnt find it and ended up
>>> installing from source!
>>>
>>> Thanks a million,
>>> Luis Miguel Silva
>>>
>>> On Mar 1, 2011, at 6:11 PM, Nan Liu <[email protected]> wrote:
>>>
>>>> You shouldn't need to deploy puppet-module if you installed puppet
>>>> enterprise, it should be part of the installation and the executable
>>>> should be located in /opt/puppet/bin.
>>>>
>>>> Thanks,
>>>>
>>>> Nan
>>>>
>>>> On Tue, Mar 1, 2011 at 6:00 PM, Luis Miguel Silva
>>>> <[email protected]> wrote:
>>>>> Thanks!
>>>>>
>>>>> I tried deploying puppet-module yesterday but had a lot of problems
>>>>> with Ruby dependencies (since Puppet Enterprise ships with its own
>>>>> ruby libs).
>>>>>
>>>>> Thanks,
>>>>> Luis
>>>>>
>>>>> On Tue, Mar 1, 2011 at 4:34 PM, Nan Liu <[email protected]> wrote:
>>>>>> You can use puppet-module to download modules from forge and you just
>>>>>> need to rename the folder to remove the author name afterwards.
>>>>>>
>>>>>> cd /etc/puppetlabs/puppet/modules/
>>>>>> puppet-module install bobsh-iptables
>>>>>> mv bobsh-iptables iptables.
>>>>>>
>>>>>> We don't have a way to make classes in modules show up in dashboard,
>>>>>> that's the feature request I was discussing about. You can scan the
>>>>>> available class using grep -r class *.
>>>>>>
>>>>>> There's a rake task that will allow you to add classes to dashboard,
>>>>>> but it doesn't have any scanning capabilities.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Nan
>>>>>>
>>>>>> On Tue, Mar 1, 2011 at 4:26 PM, Luis Miguel Silva
>>>>>> <[email protected]> wrote:
>>>>>>> Dear Nan,
>>>>>>>
>>>>>>> As i mentioned in a previous email, thanks a lot for this info!
>>>>>>>
>>>>>>> Do you know how can i download extra modules from the repos and add
>>>>>>> them to Puppet?
>>>>>>> It's not a problem if i have to do it from the shell, i just don't
>>>>>>> know if it is possible to download all of them at the same time AND
>>>>>>> how to make them show up in the dashboard.
>>>>>>>
>>>>>>> Thank you,
>>>>>>> Luis
>>>>>>>
>>>>>>> On Mon, Feb 28, 2011 at 4:41 PM, Nan Liu <[email protected]> wrote:
>>>>>>>> On Mon, Feb 28, 2011 at 4:17 PM, Luis Miguel Silva
>>>>>>>> <[email protected]> wrote:
>>>>>>>>> Dear all,
>>>>>>>>>
>>>>>>>>> I've been watching the installation how to video on PuppetLabs's
>>>>>>>>> website but i don't understand where to get mcollective OR how to
>>>>>>>>> clone the repos with all the modules (all at once)?
>>>>>>>>> http://www.puppetlabs.com/misc/pe-files/
>>>>>>>>
>>>>>>>> Currently, MCollective is not part of Puppet Enterprise, sorry for the
>>>>>>>> confusion in the original video. See:
>>>>>>>> http://www.puppetlabs.com/blog/puppet-enterprise-installation-2/
>>>>>>>>
>>>>>>>>> I noticed there are mcollective-common, mcollective-server and
>>>>>>>>> mcollective-client rpm files BUT installing them did not install the
>>>>>>>>> mc-* commands that are used in the video...
>>>>>>>>
>>>>>>>> Depending on the version of MCollective, the latest version is single
>>>>>>>> executable so
>>>>>>>>
>>>>>>>> mc ping
>>>>>>>> mc inventory
>>>>>>>> ...
>>>>>>>>
>>>>>>>> You also need ActiveMQ/RabbitMQ, please see documentation for more
>>>>>>>> details:
>>>>>>>> http://docs.puppetlabs.com/mcollective/reference/basic/gettingstarted.html
>>>>>>>>
>>>>>>>>> Also, i tried manually installing one of the modules
>>>>>>>>> (DavidSchmitt-apache-1.0.0) by downloading the .tar.gz file and
>>>>>>>>> putting the compressed file's contents at
>>>>>>>>> /etc/puppetlabs/puppet/modules but i could not see them under the
>>>>>>>>> dashboard...
>>>>>>>>
>>>>>>>> Currently, dashboard does not autoload classes in modules and we have
>>>>>>>> a feature request to detect and import classes into dashboard.
>>>>>>>>
>>>>>>>>> I also noticed i could not use the helloworld class (which,
>>>>>>>>> supposedely, ships with Puppet).
>>>>>>>>
>>>>>>>> Add helloworld to the list of classes in dashboard first, then you can
>>>>>>>> use it for any node. You can also specify it in site.pp
>>>>>>>>
>>>>>>>> node hostname {
>>>>>>>> include helloworld
>>>>>>>> }
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Nan
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>
>>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.