On 09/09/20 13:53:36, 'Dirk Heinrichs' via Puppet Users wrote:
> Am Mittwoch, den 09.09.2020, 06:34 -0700 schrieb Marty Ewings:
> 
> > https://puppet.com/docs/puppet/6.17/lang_data_sensitive.html
> > You need to "unwrap" the sensitive data in order to consume the
> > original data in a function
> 
> Yes, did that, too. And that works. However, the data is then shown in
> clear again (in the diff, or in the command of an exec) , so I gained
> exactly nothing.

The following snippet redacts the content from log output but stores the 
cleartext in the resulting
file, thus doing what you are looking for

```
  file { "${home}/.meraki_env":
    ensure  => file,
    owner   => $user,
    group   => $group,
    content => Sensitive("export 
MERAKI_DASHBOARD_API_KEY=${dashboard_api_key}"),
    mode    => '0600',
  }
```

Cheers,

Mattias

-- 
Mattias Giese
Linux Consultant und Trainer
Mail: [email protected]

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt, HRB 3537

-- 
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/20200909141421.dinia4xd5bexwxil%40gintonic.

Attachment: signature.asc
Description: PGP signature

Reply via email to