Jan Troják
11/25/2025, 1:06 PMpassword_hash to define:
define postgresql::server::role (
Boolean $update_password = true,
Variant[Boolean, String, Sensitive[String]] $password_hash = false,
my value is product of defered function:
$password = Deferred('vault_lookup::lookup', ["path", { 'field' => $_vault_field }])
postgresql::server::role { $_username:
password_hash => $password,
}
The problem is that i am getting error, since the vault_lookup::lookup function return type Sensitive not Sensitive[String]. and i am getting
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Postgresql::Server::Role[seaweedfs]: parameter 'password_hash' expects a value of type Boolean, String, or Sensitive[String], got Sensitive (file: ****/provision.pp, line: 63) on node ****
Is there a way how to retype to Sensitive[String] in defered way? Or do you see any other option how to pass the value to the function?