当我在已分配此类的计算机上运行puppet时,出现以下错误。
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Class[<<dir_for_node_type>>::<brand_dir>::Awscli] is already declared;
cannot redeclare at /etc/puppet/environments/prod/modules/<dire_for_node_type>/manifests/<brand_dir>/awscli.pp:3 at /etc/puppet/environments/prod/modules/<dir_for_node_type>/manifests/<brand_dir>/awscli.pp:3:2 on node <node_name>
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
我在参数文件中有以下内容,该文件位于单独的存储库中:
cat /<rep_name>/modules/<dir_for_node_type>/manifests/<brand_dir>/awscli.pp
class <dir_for_node_type>::<brand_dir>::awscli
{
class { 'awscli':
} ->
awscli::profile { 'default':
aws_access_key_id => '<key_id>',
aws_secret_access_key => '<sec_key_id>'
}
}
我试图在我的本地复制这个错误,我只是在site.pp中输入两次类,我得到了一个非常类似的错误,但输出略有不同,因为它给出了两个声明的确切位置,如果上面的错误没有给出第一个声明,这里是我在本地的错误:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Duplicate declaration: Class[Awscli] is already declared in file /etc/puppet/manifests/site.pp:8;
cannot redeclare at /etc/puppet/manifests/site.pp:24 on node <node_name>
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run