Hello, i am struggling with sensitive value, so i ...
# puppet
j
Hello, i am struggling with sensitive value, so i thought that i may ask here (if its not a problem) I am passing argument
password_hash
to define:
Copy code
define postgresql::server::role (
  Boolean                                     $update_password  = true,
  Variant[Boolean, String, Sensitive[String]] $password_hash    = false,
my value is product of defered function:
Copy code
$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
Copy code
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?