Hi,

For fun and (non-)profit I decided to put some effort into creating a new 
ansible lookup plugin last weekend. Primarily for my own needs, but also 
inspired by a fellow hacker at my local hackerspace.

As this is my first plugin for ansible I'm sure things could be better. 
Therefore I present to you to review, use or otherwise criticize, a pass lookup 
module. For those interested, it can be found at 
https://github.com/morphje/ansible_pass_lookup.

My usecases were (examples in the readme too):
lookup a password (  password="{{ lookup('pass', 'example/test'}}  )
If the password does not exist, create one at random (specified by create=true 
flag)
If the password exists and needs to be overwritten (create=true overwrite=true)
change the directory of the password store (specified by directory=dir)
specify the password length when creating (specified by length=42, default is 
16 chars)
return all lines from the password file (specified by returnall=true)
switch to a different pass directory (specified by 
directory=\home\morphje\projects\fooproject\pass)

Finally i wanted to ensure myself that old passwords and comments were retained 
when updating passwords, so this lookup adds a copy of old content/password in 
the password file when a new password is inserted.

For now all functionality does seem to work and i've tested both with the 
latest stable version of pass and the Ubuntu 14.04 default.
I have tested this plugin on ansible 2.0.1, but it should work on earlier 
versions too.
Looking forward to your replies.

Regards,
Patrick Deelman
_______________________________________________
Password-Store mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to