In regard to: [Puppet Users] Re: Apply multiple defines in sequence, Erwin...:

Thanks again for you reply, but it seems like you don't fully understand
what I'm having problems with. So I'll try to clarify it a little more:
1. The current way of using two defines is working flawlessly. So I (at
least partly) understand the concepts surrounding those.
2. Because I have two types of machines: some with just sugar and some with
sugar and wordpress, I now use two defines that overlap in part (define1
contains all kinds of info about creating sugar db + unpacking tar, etc,
while define2 contains all the sugar info of define1 + stuff about creating
a wordpress db + unpacking wp tar, etc), this means editing two files when
I change something in the sugar define.

So have one additional parameter to your define,

        sugar_with_wordpress => 'no'

and then in the body of your define, after you've done all the necessary
setup for sugar, that is always present, have

  if $sugar_with_wordpress == 'yes' {
     # wordpress-specific stuff here
  }

I use yes/no strings instead of boolean true/false because you'll
eventually want to have those settings come from hiera, and as things
currently stand booleans from hiera are just a trap for the unwary.

I would actually do the wordpress stuff as a separate class, which has
its own wordpress::instance define, and then call that define from within
your sugar::instance define.

Tim
--
Tim Mooney                                             tim.moo...@ndsu.edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, IACC Building                             701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
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