Am Sonntag, dem 09.01.2022 um 15:31 +0100 schrieb Helmut Schneider:

Unfortunately I'm not able to adapt it to my needs:

$array = []
[1, 2, 3].each |$variable| {
  add $variable to $array
}

Any tips?

The first link you posted already has the answer. Puppet variables are 
immutable so you can't create an empty array and then add vaules to it. It must 
be done in one step and, as that answer says, you'll have to use the map 
function, like

$array = [1, 2, 3].map |$var| { $var }

HTH...

Dirk

--

Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Phone: +49 2226 15966 18
Email: dhein...@opentext.com<mailto:dhein...@opentext.com>
Website: 
www.recommind.de<mail://ab5defde1fa49913f64f8482009c4be447b3cf96/Gesendete%20Elemente/www.recommind.de>
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, 
Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht 
gestattet.

-- 
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/813ba6695bc47bcfd0113b0cc91def4704b34b26.camel%40opentext.com.

Reply via email to