So, assuming that you were to export this resource on 2 different hosts.  
How could you collect it <<| |>>, as there could only be one 
/etc/something.conf on that collecting host.  That's why the exported 
resource path needs to be unique, can't just name it something unique if 
the resulting file would be in conflict.

On Monday, April 8, 2024 at 4:41:47 AM UTC-7 Albert Shih wrote:

> Le 08/04/2024 à 11:01:27+0000, 'Dirk Heinrichs' via Puppet Users a écrit
> Hi
>
> > 
> > > $group_hosts.each | String $host | {
> > >   @@file { "file for ${host}":
> > >     ensure => present,
> > >     name   => "file for ${host}",
> > >     path   => '/etc/something.conf',
> > >     tag    => "File for ${host}",
> > >     etc.
> > >     }
> > > }
> > 
> > You create multiple resources here (one for each host), which ALL try
> > to manage the SAME file ("/etc/something.conf"). But one file can only
> > be managed by one resource. That needs to be something like
>
> Yes...I know that but I'm also using “@@” who export the file to «others
> host». So even I can understand why it's not working I think that would be
> nice if it does. 
>
> Be re-reading the doc of file ressource I understand that 
>
> $namevar = $path
>
> but IMHO it should be
>
> if $name is underf
> $namevar = $path
> else
> $namevar = $name
>
> I find another solution but it need a little more configuration from the
> user of the module. 
>
> > 
> > HTH...
>
> Thanks. 
>
> Regards. 
>
> -- 
> Albert SHIH 🦫 🐸
> France
> Heure locale/Local time:
> lun. 08 avril 2024 13:36:58 CEST
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ae5e5ac0-d13b-41a1-aca6-3fa489415bb0n%40googlegroups.com.

Reply via email to