我正在尝试将参数传递给类但是遇到了重复声明错误。文档说明了这一点:https://github.com/puppetlabs/puppetlabs-apache#class-apachemodalias
以下产量:
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',
}
答案 0 :(得分:0)
由于apache模块默认包含别名模块,因此需要设置apache的default_mods
参数。以下将禁用所有默认模块,允许您明确定义自己的模块。
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',
}