0

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?

рüффп
  • 620
  • 1
  • 11
  • 24
nelaaro
  • 584
  • 4
  • 9
  • 25

1 Answers1

0

The issue was with how I had declared my hiera data.

duplicity::profile:
  - 'testfails'

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.

duplicity::profile: 'testthatworks'

That correctly creates the directory without []

nelaaro
  • 584
  • 4
  • 9
  • 25