On Tuesday 29 December 2009 16:30:58 Ben wrote:
> ok so just to confirm, if I understand correctly classes will not be
> evaluted unless they are used within an include.

yes

> I've restored my site.pp so now it's go two classes, "files1" and
> "files2" both managing file resources.
>
> I've also specified all nodes using the default node function, all
> nodes should include the "appserver" class (which requires files1 and
> files2 classes)

see below

> (I've upgraded my puppet version 24.8 which supports multiple class
> relationships)
>
> [r...@xldn1564vdap manifests]# cat /etc/puppet/manifests/site.pp
> node default {
>         include appserver
> }
>
> class appserver {
>         service { "appserver":
>         require => Class ["files1", "files2"]
>         }
> }
>
> class files1 {
>         file { "/etc/motd":
>         group => "puppet",
>         }
> }
>
> class files2 {
>         file { "/etc/puppet/facts.conf":
>         group => "puppet",
>         }
> }
>
> But on testing it fails to find the classes files1 or files2

Because you're not including them anywhere.  'require' is only used to specify 
ordering, i.e. here that resources in class 'files1' and 'files2' are applied 
before Service['appserver'] because it requires them.

What you need in this example is sth more like

class appserver {
    include files1
    include files2
    service { 'appserver': require => Class['files1', 'files2'] }
}



-- 
Michael Gliwinski
Henderson Group Information Services
9-11 Hightown Avenue, Newtownabby, BT36 4RT
Phone: 028 9034 3319

**********************************************************************************************
The information in this email is confidential and may be legally privileged.  
It is intended solely for the addressee and access to the email by anyone else 
is unauthorised.
If you are not the intended recipient, any disclosure, copying, distribution or 
any action taken or omitted to be taken in reliance on it, is prohibited and 
may be unlawful.
When addressed to our clients, any opinions or advice contained in this e-mail 
are subject to the terms and conditions expressed  in the governing client 
engagement leter or contract.
If you have received this email in error please notify 
[email protected]

John Henderson (Holdings) Ltd
Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, 
BT36 4RT.
Registered in Northern Ireland
Registration Number NI010588
Vat No.: 814 6399 12
*********************************************************************************

--

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.


Reply via email to