Open nogweii opened 5 years ago
Thanks for the idea. I think having some functionality around using the bw generate
command would be interesting. One thing I wonder about is how to specify the parameters to the generate
command. I think we could specify some sane defaults, but in the case where someone needed to override them (changing the length, char set, etc.), I'm not sure how that would look. Any ideas or PRs are most certainly welcome.
The pass
lookup module supports this feature. It does a pretty good job of specifying length, char set, etc.: https://docs.ansible.com/ansible/latest/plugins/lookup/passwordstore.html.
Note that the char set support isn't as flexible as pass
or bw
allows, which is perhaps acceptable for improved UX. However, I wrote an alternate implementation to specify char set (https://github.com/ansible/ansible/pull/44541), which would allow using bw generate
as flexibly as the CLI itself does. I think both approaches have merit.
I think that just providing a function to store a generated password may be enough? Then you generate it with whathever method you want (ansible built-in password generator, openssh, /dev/random) and save it to bitwarden?
A new option to create a random password and an associated entry if it doesn't exist. Much like the password lookup plugin in core ansible.