When I try the following in my manifest.
$profile = hiera('duplicity::profile', 'test123')
file { [ "/tmp/${profile}" ]:
ensure => directory,
owner => root,
group => root,
}
I have the following defined in the heira for that node
duplicity::profile:
- 'testfails'
Which creates folders like this
find /tmp/\[testfails\]
/tmp/[testfails]
Why is it adding the brackets into the folder name?
The issue was with how I had declared my hiera data.
That creates a list or array of values. It does not make sense to try and create a directory out of list or array. I should either iterate through the list or ensure that I only allow single string values.
Where this assigns a single string to the variable.
That correctly creates the directory without
[]