Resource type exec, Deferred, and Vault

27 views
Skip to first unread message

Bob Negri

unread,
Jun 8, 2023, 8:28:41 AM6/8/23
to Puppet Users
Is it possible to use Deferred with the command in resource type exec?

The code we are trying to replace to use a Vault secret has an gpg key as a passed in secret. I saw a code example in Ben Ford's blog post.

notify { 'vault server debugging': # Defer interpolation to runtime after the value is resolved. message => Deferred( 'sprintf', ['Password: %s', $db_password] ), }

I was wondering if similar logic could be used for exec? And maybe %p is better for a key than %s.

Bob Negri

unread,
Jun 9, 2023, 6:56:52 PM6/9/23
to Puppet Users
Answer is, it seems to work with Deferred('sprint', ['Password: %s', $db_password].
There are issues around special characters in the password string, like and exclamation point.

Reply all
Reply to author
Forward
0 new messages