| There are two issues going on. This ticket is about the notify resource printing messages 1 and 2 to the console, which ends up logs. The second issue is that the compiler evaluates these differently, which is surprising UX:
$secret = Sensitive('secret') |
notify { 'a': message => $secret } |
notify { 'b': message => "${secret}" }
|
The resulting catalog contains:
{ |
"type": "Notify", |
"title": "a", |
"tags": [ |
"notify", |
"a", |
"class" |
], |
"file": "/etc/puppetlabs/code/environments/production/manifests/site.pp", |
"line": 5, |
"exported": false, |
"parameters": { |
"message": "secret" |
}, |
"sensitive_parameters": [ |
"message" |
] |
}, |
{ |
"type": "Notify", |
"title": "b", |
"tags": [ |
"notify", |
"b", |
"class" |
], |
"file": "/etc/puppetlabs/code/environments/production/manifests/site.pp", |
"line": 6, |
"exported": false, |
"parameters": { |
"message": "Sensitive [value redacted]" |
} |
}
|
The compiler preserves the sensitive value for resource "a" and marks it as sensitive, while resource "b" is coverted to the string "Sensitive [value redacted]", which is lossy. |