我在 mon.pp 文件中声明了这一点
$pem_file_path = "/etc/ssl/private/${::environment}.pem"
$defaults = hiera_hash('defaults')
$subscription_id = $defaults['subscription_id']
$pem_file_content = hiera('nb_monitoring::azure_limits_sa::pem_file_content')
file { $pem_file_path:
ensure => 'present',
owner => 'root',
group => 'root',
mode => '0600',
content => $pem_file_content
}
}
在另一个不同的模块中> azure_limits_sa.pp 我正在使用相同的东西
# From ${::env}/mon.yaml
$pem_file_content = hiera('nb_monitoring::azure_limits_sa::pem_file_content')
file { $pem_file_path:
ensure => 'present',
owner => 'root',
group => 'root',
mode => '0600',
content => $pem_file_content
}
当我运行 puppet 时,出现此错误:
Error: Duplicate declaration: File[/etc/ssl/private/dev1.pem] is already declared in file /tmp/vagrant-puppet/modules-2134b0ea668add24edb5ea5a9ee9f8a1/nb_tsg/manifests/mon.pp:25; cannot redeclare at /tmp/vagrant-puppet/modules-2134b0ea668add24edb5ea5a9ee9f8a1/nb_monitoring/manifests/azure_limits_sa.pp:43 on node dev1-mon1
我该如何解决这个问题?