Closed loicbr closed 9 years ago
array_append
is used to append to a value already in the file. It doesn't allow you to reference a variable more than once in the Puppet code.
What you should do is probably concatenate your variable, like so:
$value1 = 'value1'
$value2 = 'value2'
$value = "${value1} ${value2}"
shellvar { 'I2_TYPE':
ensure => present,
target => '/etc/facter/facts.d/icinga2',
value => $value,
}
I would like to use shellvar to add values to the same varaible from different manifests. I tried the following :
But I receive the following error : Error: Failed to apply catalog: Cannot alias Shellvar[I2_TYPE_2] to ["I2_TYPE"] at /etc/puppet/environments/facts/roles/base/manifests/hosts/node02.pp:26; resource ["Shellvar", "I2_TYPE"] already declared at /etc/puppet/environments/facts/roles/base/manifests/hosts/node02.pp:19