1

これを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
 }

パペットを実行すると、次のエラーが発生します。 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

どうすればこれを解決できますか?

4

2 に答える 2