Context: Hiera provides the Convert-Function lookup_options: }}{{{}blubb::my_variable1: }}{{ convert_to: Sensitive }}{{{}blubb::my_variable2: }}{{ convert_to: Sensitive {{}} blubb::my_variable1: MY_PASSWORD # Variable intentionally left empty blubb::my_variable2:{} {{}} With blubb::my_variable2 this leads to Sensitive[undef], and this makes... class blubb( Optional[Variant[String, Sensitive[String]]] $my_variable2, ) {} ... not accepting the Variable: Class[Blubb]: parameter 'my_variable2' expects a value of type String or Sensitive[String], got Sensitive[Undef] Improvement: The Convert-Function should leave undef unconverted, and return just undef instead of Sensitive[undef]. References: https://github.com/theforeman/puppet-katello/pull/436#discussion_r802535218 . |