Le 30/03/2024 à 11:04:55+0100, Martin Alfke a écrit
> 

Hi, 

> >>> 
> >>> 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). 
> 
> To be more precise:
> 
> 1. the combination of resource type and title must be unique
> AND
> 2. the combination of resource type and namevar must be unique

OK. But with that I still got the same error

$group_hosts.each | String $host | {
  @@file { "file for ${host}":
    ensure => present,
    name   => "file for ${host}",
    path   => '/etc/something.conf',
    tag    => "File for ${host}",
    etc.
    }
}

In this situation the namevar or the ressource change at each host. So 
for me the both condition are validate. But I still got the same 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


Regards.

-- 
Albert SHIH 🦫 🐸
France
Heure locale/Local time:
lun. 08 avril 2024 12:11:10 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ZhPEOlEjq2P3avwq%40io.chezmoi.fr.

Reply via email to