Skip to content

Commit

Permalink
remove print and add infos about the list parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-heusel committed Jan 17, 2023
1 parent d7440ad commit b64fbd9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,26 @@ You can use parameters to control how `pass generate` will be called.
* **`length`:** length of the generated password (default: `32`).
* **`symbols`:** include symbols in the generated password (default: `False`).
* **`regenerate`:** force the generation of a new password (default: `False`).
* **`list`:** list the passwords under the given path (default: `False`).

### Example

#### Get a single password

```yaml
password: "{{ lookup('gopass', 'path/to/your/password', length=16, symbols=True, regenerate=True) }}"
```

#### Get all passwords under a path

```yaml
- debug:
msg: "{{ lookup('gopass', item) }}"
# https://docs.ansible.com/ansible/latest/reference_appendices/logging.html#protecting-sensitive-data-with-no-log
# no_log: true
with_items: "{{ lookup('gopass', 'heuselfamily/mqtt/', list=True) }}"
```

## License & Acknowledgements

The contents of this repository are based on https://github.com/gcoop-libre/ansible-lookup-plugin-pass and share a common history.
Expand Down
1 change: 0 additions & 1 deletion lookup_plugins/gopass.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def list_password(path):
(stdout, stderr) = process.communicate()
if process.returncode == 0:
lines = [line.decode("utf-8") for line in stdout.splitlines()]
print(lines)
return lines

raise Exception(stderr)
Expand Down

0 comments on commit b64fbd9

Please sign in to comment.