Re: [Puppet Users] Copying a hash with changes

2015-03-04 Thread Tom Limoncelli
On Sat, Feb 28, 2015 at 2:25 PM, Dan White wrote: > $new_hash = { > 'log' => "${log_ip} local0", > } > > $global_options = merge ( $haproxy::params::global_options, $new_hash ) > Thanks, Dan! I'll do that while I wait for Puppet 4.0 (or when I can use the future parser). On Sun, Mar 1, 2015

Re: [Puppet Users] Copying a hash with changes

2015-03-01 Thread Henrik Lindberg
On 2015-28-02 19:27, Tom Limoncelli wrote: I want to copy a hash to a variable but change some settings along the way. For example: I have $haproxy::params::global_options (which is a hash) and I want to create a copy with some changes. I tried this: $global_options = $haproxy::params::glob

Re: [Puppet Users] Copying a hash with changes

2015-02-28 Thread Garrett Honeycutt
On 2/28/15 1:27 PM, Tom Limoncelli wrote: > I want to copy a hash to a variable but change some settings along the way. > > For example: > > I have $haproxy::params::global_options (which is a hash) and I want > to create a copy with some changes. > > I tried this: > $global_options = $haproxy

Re: [Puppet Users] Copying a hash with changes

2015-02-28 Thread Dan White
Make a hash with the update in it and then merge them (needs stdlib) Like this: $new_hash = { 'log' => "${log_ip} local0", } $global_options = merge ( $haproxy::params::global_options, $new_hash ) https://forge.puppetlabs.com/puppetlabs/stdlib#reference • merge: Merges two or more hashes tog

[Puppet Users] Copying a hash with changes

2015-02-28 Thread Tom Limoncelli
I want to copy a hash to a variable but change some settings along the way. For example: I have $haproxy::params::global_options (which is a hash) and I want to create a copy with some changes. I tried this: $global_options = $haproxy::params::global_options += { 'log' => "${log_ip} loc