1

I am trying to pass parameters to a class but am running into a Duplicate declaration error. The docs state this: https://github.com/puppetlabs/puppetlabs-apache#class-apachemodalias

The following yields: Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Apache::Mod[alias] is already declared

class { 'apache':
  server_signature  => 'off',
  trace_enable      => 'off',
  mpm_module        => 'prefork'
}

include apache::mod::headers
include apache::mod::rewrite
class { 'apache::mod::alias':
  icons_options => 'None',
}
mrbnetworks
  • 2,547
  • 3
  • 17
  • 10

1 Answers1

0

The default_mods parameter for apache needs to be set since the apache module includes the alias module as a default. The following will disable all default modules allowing you to explicitly define your own.

default_mods => false

class { 'apache':
  server_signature  => 'off',
  trace_enable      => 'off',
  mpm_module        => 'prefork',
  default_mods        => false
}

include apache::mod::headers
include apache::mod::rewrite
class { 'apache::mod::alias':
  icons_options => 'None',
}
mrbnetworks
  • 2,547
  • 3
  • 17
  • 10