Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Deferred for the mysql::password function #1581

Open
tuxmaster5000 opened this issue Jul 8, 2023 · 5 comments
Open

Add Deferred for the mysql::password function #1581

tuxmaster5000 opened this issue Jul 8, 2023 · 5 comments

Comments

@tuxmaster5000
Copy link

Use Case

The puppet deferred construct allow to get values from outside of puppet.
For example Hashicorp Vault using
https://forge.puppet.com/modules/puppet/vault_lookup

Describe the Solution You Would Like

That an call to:
mysql::password(Deferred('',[])) will work.
Until not only the error:
'mysql::password' parameter 'password' expects a value of type String or Sensitive[String], got Deferred
will reported.

@alexjfisher
Copy link
Collaborator

Are you also deferring the call to mysql::password?

@tuxmaster5000
Copy link
Author

What do you mean? I have used the sample code above.

@alexjfisher
Copy link
Collaborator

If the call to mysql::password itself isn't deferred, how would it produce an output when compiled on the puppet server?

So does something like...

Deferred('mysql::password', [
  Deferred('vault_lookup::lookup', ["secret/test", 'https://vault.docker:8200'])
])

work?

@tuxmaster5000
Copy link
Author

I will test it next weekend.

@tuxmaster5000
Copy link
Author

Hi @alexjfisher , to day I tested it, and this works.
So it will be nice, when the usage will be noted in the documentation, because Deferred is used more and more, because the puppet code is often hold in git repos, where clear passwords or hashes are big problems. Here my used code for an full example:

mysql_user { "${name}@${host}":
password_hash => Deferred('mysql::password', [Deferred('',[)])
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants