Skip to content

Commit b64fbd9

Browse files
remove print and add infos about the list parameter
1 parent d7440ad commit b64fbd9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,26 @@ You can use parameters to control how `pass generate` will be called.
5151
* **`length`:** length of the generated password (default: `32`).
5252
* **`symbols`:** include symbols in the generated password (default: `False`).
5353
* **`regenerate`:** force the generation of a new password (default: `False`).
54+
* **`list`:** list the passwords under the given path (default: `False`).
5455

5556
### Example
5657

58+
#### Get a single password
59+
5760
```yaml
5861
password: "{{ lookup('gopass', 'path/to/your/password', length=16, symbols=True, regenerate=True) }}"
5962
```
6063

64+
#### Get all passwords under a path
65+
66+
```yaml
67+
- debug:
68+
msg: "{{ lookup('gopass', item) }}"
69+
# https://docs.ansible.com/ansible/latest/reference_appendices/logging.html#protecting-sensitive-data-with-no-log
70+
# no_log: true
71+
with_items: "{{ lookup('gopass', 'heuselfamily/mqtt/', list=True) }}"
72+
```
73+
6174
## License & Acknowledgements
6275

6376
The contents of this repository are based on https://github.com/gcoop-libre/ansible-lookup-plugin-pass and share a common history.

lookup_plugins/gopass.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def list_password(path):
8383
(stdout, stderr) = process.communicate()
8484
if process.returncode == 0:
8585
lines = [line.decode("utf-8") for line in stdout.splitlines()]
86-
print(lines)
8786
return lines
8887

8988
raise Exception(stderr)

0 commit comments

Comments
 (0)