> On 29. Mar 2024, at 14:37, Albert Shih <[email protected]> wrote:
> 
> Hi, 
> 
> I'm not 100% sure it's a bug, just 99%. What do you think ? 
> 
> If I do something like
> 
>  $group_hosts.each | String $host | {
>    @@file { "file for ${host}":
>      ensure => present,
>      path   => '/etc/something.conf',
>      tag    => "File for ${host}",
>      etc.
>      }
>  }
> 
> I got a error 
> 
> Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
> Server Error: Evaluation Error: Error while evaluating a Resource Statement, 
> Cannot alias File[file for host1] to ["/etc/something.conf"] at (file: 
> /etc/puppetlabs/code/environments/x/modules/thing/manifests/thing.pp, line: 
> 72); resource ["File", "/etc/something.conf"] already declared (file: 
> /etc/puppetlabs/code/environments/x/modules/thing/manifests/thing.pp, line: 
> 72) (file: 
> /etc/puppetlabs/code/environments/x/modules/thing/manifests/thing.pp, line: 
> 72, column: 5) on node XYZ
> 
> I don't see why I cannot export the same file name (with different
> ressource name) to different hosts. 

The combination of resource type, title and namevar must be unique.
path is the namevar of the file resource type.

> 
> puppet client : 7.29.1 (Debian/puppetlabs official package)
> puppet server: 7.16.0 (Debian/puppetlabs official package)
> 
> Regards
> 
> 
> -- 
> Albert SHIH 🦫 🐸
> France
> Heure locale/Local time:
> ven. 29 mars 2024 14:21:14 CET
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/ZgbEFHrNHUQHQi3g%40io.chezmoi.fr.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5A86E017-887E-41A1-B676-16F36A949611%40gmail.com.

Reply via email to