Hello,
I've a problem with hiera and functions.

I'd like to manage a postgresql role like this:
 

postgresql::server::role { 'marmot':  password_hash => 
postgresql_password('marmot', 'mypasswd'),}


In above, how can I use hiera in the function part?

I tried:
  postgresql::server::role { [hiera(my::db::user)]:
    password_hash => postgresql_password([hiera(my::db::user), 
hiera(my::db::pass)]),
  }

where hiera variables:
my::db::user: 'marmot'
my::db::pass: 'mypasswd'

The error was:
Error 400 on SERVER: can't convert Array into String

I also tried a merged hiera variable as array but it didnt work either:

  postgresql::server::role { [hiera(my::db::user)]:
    password_hash => postgresql_password([hiera(my::db::userpass)]),
  }

where i defined the hiera variable as array,
  my::db::userpass:
    - 'marmot'
    - 'mypasswd'

But got an error like this:
Error 400 on SERVER: postgresql_password(): Wrong number of arguments given 
(1 for 2)

I also tried hiera_array and hiera_hash but none of them helps.

Any clues?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5e9a0388-6db9-4adb-9326-35623a39aafd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to