On Monday, November 5, 2012 3:48:58 AM UTC-6, Erwin Bogaard wrote: > > 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. As this can lead to > differing configurations because of editing errors (and always twice the > work), I would like to be able to split the defines up, so I can call > define1 (sugar) on all machines and define1 (sugar) and sefine 2 > (wordpress) on the other machines. > 3. Some of the variables are shared, for example the mysqld_pwd is used > twice, and I add a different suffix for sugar and wordpress to get two > databases. For the httpd-configuration, I specify a different template, > which is easy to to with defines. So all instances have unique resources, > hence the choice for defines, not classes. > > Does this help you help me? >
No, not really. You have been relatively clear about what you are trying to accomplish, but I don't understand what is preventing you from accomplishing it. Perhaps that means you're stumbling over something that seems trivial to me. For example, if the real question is how to share data between two or more defined types, then you have at least three choices: 1. Define the data in a class, and have each definition reference the class variables instead of taking that data in the form of parameters. 2. Externalize the data (e.g. into an Hiera data store), and have each definition reference the needed values by the same fixed key. 3. Record the data in global variables, and have each definition reference the global values. (I wouldn't recommend this one except as a temporary hack.) If that doesn't help then perhaps you should try reducing the problem to the simplest possible example that captures the issue. Often such an exercise will itself help you work out the problem, but if it doesn't then we can be a lot more helpful to you with actual (simple) manifests to critique. John -- 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/-/X60w8VUoFjIJ. 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.