On Thursday, December 4, 2014 9:50:56 AM UTC+1, Martijn Grendelman wrote:
>
> Hi Henrik and Wil,
>
> > Is there ANY way that the notifys in the apache::vhost type would
>> > display a different value? Shouldn't $apache::params::priority and
>> > $priority not be the same?
>> >
>> > I have a case where on /some/ nodes, $priority (and other parameters
>> > that have defaults from $::apache::params that I omitted here) are
>> > empty (undef). If I access $::apache::params::priority directly, the
>> > correct value is presented.
>> > This code is in use on many nodes, and most don't exhibit the problem.
>> >
>> > Any idea what might be the problem here? I've been trying different
>> > things for over an hour, and I'm afraid I'm losing my sanity...
>> >
>> You have an order of evaluation problem primarily. See here for an
>> explanation of in which order classes and defines are evaluated:
>>
>> http://puppet-on-the-edge.blogspot.se/2014/04/getting-your-puppet-ducks-in-row.html
>>
>>
>> The problem is that you have not included the class (and thus not
>> defined the parameter $::apache::params::priority) at the time
>> you are instantiating the resource apache::vhost{test: }. If you instead
>> include the class prior to instantiating the resource it may work better.
>>
>> (Or organize the thing differently once you read about the order classes
>> and defines are evaluated.)
>>
>
> Thank you both for helpful tips. I see I need to rethink some stuff :-)
>
>
Hence the following code in puppetlabs-apache's vhost type:
# The base class must be included first because it is used by parameter
defaults
if ! defined(Class['apache']) {
fail('You must include the apache base class before using any apache
defined resources')
}
I get it now :-)
Thanks again,
Martijn.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/0d0d06d0-7341-4bbd-bbbb-f22d9a60d334%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.