On Thursday, January 17, 2013 3:50:14 AM UTC+11, jcbollinger wrote:
>
>
>
> On Tuesday, January 15, 2013 5:30:09 PM UTC-6, Michael Dodwell wrote:
>>
>> Hi,
>>
>> I currently have puppet setup and backed into the dashboard and using 
>> ENC. 
>>
>> I wish to control as much of the configuration of machines via the 
>> dashboard. 
>>
>> However, I have a requirement to call a module/class multiple times and 
>> was wondering if this is possible?
>>
>
> It is not possible with Dashboard or by any other means if you are 
> specifying class parameters.  It is not meaningful or useful if you are not 
> specifying class parameters.
>
> Do not confuse declaring the same class multiple times with declaring 
> multiple resources of the same defined type.  The latter is allowed and 
> meaningful because each resource is independent of the others.  The former 
> is not meaningful, because classes are singletons -- second and subsequent 
> declarations of the same class have no effect on the target node's 
> catalog.  On the other hand, a second or subsequent declaration of a given 
> class is erroneous if it expresses and class parameters (even if they are 
> the same as those of the first declaration).
>
> Furthermore, do recognize that even your example fails to express even a 
> single class declaration.  Instead, it expresses a declaration of a defined 
> type instance.  Neither Dashboard nor any other ENC can declare defined 
> type instances, however, so there is no help for you there.
>
> Your requirement is therefore bogus -- either useless or unfulfillable.  
> If you can offer more detail on what you're actually trying to accomplish 
> then perhaps we can suggest alternatives.
>
>
> John
>
>
Ok so for an example I have a module/class that enables apache vhost setup. 
In this example I have X web servers that are load balanced and i want to 
add all my Y virtual hosts, so working backwards I would want to create a 
group called 'web_vhosts', for example, and add to that Y class calls to 
the same apache vhost creation class but with different variables ie 
servername => "somehost.com"

Or as a more syntax correct manifest:


node somenode {

include apache

apache::vhost { 


  "my-site":
        servername => "my-site.com",
        port => 80,
        docroot => "/opt/mysite";

  "other-site":
        servername => "other-site.com",
        port => 80,

        docroot => "/opt/othersite";

  # ETC ETC


  }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/ZBtz-nmwHfIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to