Puppet 同一行上存在重复声明错误

Puppet 同一行上存在重复声明错误,puppet,devops,Puppet,Devops,我正在使用puppet创建一个模块,以便在其他模块中应用其他清单,这些清单将位于我的每个节点上,因为我不想重复手动键入每个资源。此清单将包含在不同节点上的其他类中,并将作为引用调用 windowscommoncomponents::install {'windows-common-components':} 在测试模块时,我遇到了一个“重复声明错误”。它说错误在同一清单的同一行 # Defined type to install common components to all windows

我正在使用puppet创建一个模块,以便在其他模块中应用其他清单,这些清单将位于我的每个节点上,因为我不想重复手动键入每个资源。此清单将包含在不同节点上的其他类中,并将作为引用调用

windowscommoncomponents::install {'windows-common-components':}
在测试模块时,我遇到了一个“重复声明错误”。它说错误在同一清单的同一行

# Defined type to install common components to all windows nodes.

define windowscommoncomponents::install {
  include notepadplusplus
  include vs2015redist
  include windowsutils
  include windowskbs

  # Install Notepad++
  $_notepadplusplus_version = '7.3.3'
  notepadplusplus::install { "notepadplusplus-${_notepadplusplus_version}":
    version => $_notepadplusplus_version
  }

  # Install the 2015 redist
  vs2015redist::install { 'vs2015-redist':
  }

  #Configure the Puppet service to start automatically.
  windowsutils::configurepuppetservice { 'configure-puppet-service':
  }

  #Configure the Windows Event Logs.
  windowsutils::configureeventlog { 'event-log-configuration':
  }

  # Install the Windows Security patch CVE-2019-0708.
  windowskbs::cve20190708 { 'install-cve-2019-0708':
  }
}
我希望清单能够安装Notepad++、vs2015redist、安全补丁、配置puppet服务和配置windows事件日志。我得到的错误是:

Warning: Config file C:/ProgramData/PuppetLabs/puppet/etc/hiera.yaml not found,
using Hiera defaults
Error: Duplicate declaration: Windowskbs::Cve20190708[install-cve-2019-0708] is
already declared in file Y:/Puppet/windowscommoncomponents/manifests/install.pp:
29; cannot redeclare at Y:/Puppet/windowscommoncomponents/manifests/install.pp:2
9 on node win-m6ecv2ojt53.localdomain
Error: Duplicate declaration: Windowskbs::Cve20190708[install-cve-2019-0708] is
already declared in file Y:/Puppet/windowscommoncomponents/manifests/install.pp:
29; cannot redeclare at Y:/Puppet/windowscommoncomponents/manifests/install.pp:2
9 on node win-m6ecv2ojt53.localdomain

非常感谢您的帮助。

您定义的资源类型是否在每个目录中声明了不止一次?。。。有什么理由不应该改为上课吗?