On Mar 19, 2010, at 5:05 PM, Douglas Garstang wrote:
> On Fri, Mar 19, 2010 at 4:51 PM, Patrick <[email protected]> wrote:
>>
>> On Mar 19, 2010, at 4:36 PM, Douglas Garstang wrote:
>>
>>> I've already broken it down as much as I can. The bottom class is
>>> calling the same definition 10 times to set up 10 instances of jboss
>>> on a single system, and another definition is running 10 times to
>>> setup 10 instances of tomcat on the same server (don't blame me...
>>> it's the way our software was built). So.... I can't really subclass
>>> that. It would be nice for clarity to break each definition into a
>>> separate file however. Poo.
>>>
>>> Doug.
>>>
>>
>> I misunderstood the problem. Here's something else that might be what you
>> want. You can "import" a .pp file. You could put each computer in it's own
>> computername.pp and include them all in nodes.pp or site.pp. That's why
>> nodes.pp is read. This would all be in the manifests folder. For instance,
>> putting this:
>>
>> import "nodes"
>>
>> in site.pp will do something closer to what most people think of as
>> "include" than the puppet include. That what you want?
>
> Patrick,
>
> Hmmm.... tried that and it's doing something weird. I put an import
> "foo.pp" into my node file, and it looks like puppet is trying to auto
> import that foo.pp for every single node.
>
> ie, I am seeing this...
>
> Could not retrieve catalog: Puppet::Parser::AST::Resource failed with
> error ArgumentError: Duplicate definition: Elements::Customer[tfel0]
> is already defined in file
> /etc/puppet/manifests/nodes/fr.xxx.com/foo.pp at line 12; cannot
> redefine at /etc/puppet/manifests/nodes/fr.xxx.com/app07.pp:175 on
> node app07.fr.xxx.com
>
> The app07.pp file doesn't even import foo.pp! It's in app01.pp. Bizarre.
>
> Doug
Sounds like a communications problem between us. Here's a more complete
example. Keep in mind that this isn't making anything much simpler. It just
moves it into more files. Also, every node sees every file.
site.pp:
#global site definitions
import "nodes"
#end site.pp----------------------
nodes.pp:
import "computer1"
import "computer2"
#end node.pp----------------------
computer1.pp:
node
'computer1.domain'
{
include module1
include module2
}
#end computer1.pp----------------------
computer2.pp:
node
'computer2.domain'
{
include module2
include module3
}
#end computer2.pp----------------------
--
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.