Le 29/03/2024 à 18:46:47+0100, Martin Alfke a écrit
> 
Hi, 

> > 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.

Agree. But the title is "file for ${host}" so the combination are unique (I
don't have two same values in $group_host, in fact the value inside this
array come from the key of hash table). 

Regards.

-- 
Albert SHIH 🦫 🐸
France
Heure locale/Local time:
sam. 30 mars 2024 09:33:38 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/ZgfOt-uvLC1WIXEA%40io.chezmoi.fr.

Reply via email to