On 2013-24-10 11:19, Erik Dal�n wrote:
> It is possible in a lot of puppet versions but it is a bug and might get
> fixed.
>
> $a = [1,2]
> $a[2]=3
> notice($a)
>
>
It is a bug that is planned to be fixed in Puppet 4. (It cannot be
changed in the 3.x series as it would potentially be a breaking change).
Yes, we are serious about semver :-)
The future parser (and hence also in Puppet 4) allows concatenation of
array (and merge of hash) to a *new* variable otherwise variables are
strictly immutable.
Regards
- henrik
> <mailto:
John.Bo...@stjude.org>> wrote:
>
>
>
> On Monday, October 21, 2013 1:21:18 PM UTC-5, Sergey Arlashin wrote:
>
> Hi!
> Is it possible to add a new element to an array inside puppet
> manifest ? Something like ruby's array.push('new_element') ?
>
>
>
> No, it isn't. It is a fundamental principle of Puppet that
> variables' values cannot be changed once set..
>
> In particular, the += operator Daniele refers to does not do quite
> what she supposes: it sets the initial value of a local variable by
> appending data to the value of a /separate/ variable of the same
> <mailto:
puppet-users%2Bunsu...@googlegroups.com>.
> <mailto:
puppet...@googlegroups.com>.
> Erik Dal�n