Hi,

"include" shouldn't be a problem:

https://puppet.com/docs/puppet/5.3/lang_classes.html#include-like-behavior


the problematic declariation must be one of the resource like declaration.
You can only declare a class in such format once.

define custom::apache::vhost () {
  include custom::apache
}
class custom::apache {
  class { '::apache': <- WRONG
    #parameters
  }
}

Your define calls custom::apache and in custom::apache you declar ::apache
in the resource-like format as much times as vhost you create.

Could you please show the full code? and the exact error?


Arnau



2018-06-10 23:50 GMT+02:00 Clemens Bergmann <[email protected]>:

> Hi,
>
> I found out that it does only break if I add one special vhost.
> The problematic vhost is defined as follows:
>
> class vhost::vhost3 {
>   custom::apache::vhost{
>   #parameter
>    }
>
>   include ::apache::mod::proxy
>   include ::apache::mod::proxy_http
> }
>
> If I remove the Includes everything works (but I need mod_proxy for this
> vhost).
>
>
> On Saturday, June 9, 2018 at 8:45:46 AM UTC+2, Clemens Bergmann wrote:
>>
>> What confuses me is that I before switching to puppetlabs-apache I had a
>> layout with a custom apache module as follows:
>>
>> class vhost::vhost1 {
>>   custom_apache::site{
>> #parameters
>>   }
>> }
>>
>> define custom_apache::site (#parameters) {
>>   include custom_apache::ssl
>> }
>>
>> class custom_apache::ssl (#parameters){
>>   class { 'custom_apache':
>>    #parameters
>>  }
>> }
>>
>> class custom_apache (#parameters) {
>>   include custom_apache::params
>>   class {'custom_apache::install':
>>     #parameters
>>   }
>>   class {'custom_apache::config':
>>     #parameters
>>   }
>>   class {'custom_apache::service':
>>     #parameters
>>   }
>> }
>>
>> and that worked.
>>
>> I also suspect the the line https://github.com/puppet
>> labs/puppetlabs-apache/blob/master/manifests/mod/ssl.pp#L24 to be the
>> problem. But that would also be a problem with only one vhost and that
>> works fine on another node.
>>
> --
> 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/0665b012-601b-4fac-83ff-fa7acfae9fa7%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/0665b012-601b-4fac-83ff-fa7acfae9fa7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAM69jx8D7TOBc8ZX4Z%2B7tWc_fv1GVfDVjU2xaniwCeEXxf1BUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to