feat: implement custom 1Password lookup plugin and update references in Ansible tasks
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
This commit is contained in:
@@ -14,7 +14,7 @@ The lookup plugin accepts a 1Password reference string in the format `op://vault
|
||||
```yaml
|
||||
- name: Fetch a secret from 1Password
|
||||
debug:
|
||||
msg: "{{ lookup('onepassword', 'op://vault/item/password') }}"
|
||||
msg: "{{ lookup('my_1password', 'op://vault/item/password') }}"
|
||||
```
|
||||
|
||||
## Examples
|
||||
@@ -24,14 +24,14 @@ The lookup plugin accepts a 1Password reference string in the format `op://vault
|
||||
```yaml
|
||||
- name: Fetch API key
|
||||
debug:
|
||||
msg: "{{ lookup('onepassword', 'op://My Vault/API Credentials/token') }}"
|
||||
msg: "{{ lookup('my_1password', 'op://My Vault/API Credentials/token') }}"
|
||||
```
|
||||
|
||||
### Using with templates
|
||||
|
||||
```yaml
|
||||
# In your template file (e.g., config.j2)
|
||||
api_key: "{{ lookup('onepassword', 'op://My Vault/API Credentials/token') }}"
|
||||
api_key: "{{ lookup('my_1password', 'op://My Vault/API Credentials/token') }}"
|
||||
```
|
||||
|
||||
### Multiple secrets
|
||||
@@ -40,8 +40,8 @@ api_key: "{{ lookup('onepassword', 'op://My Vault/API Credentials/token') }}"
|
||||
- name: Fetch multiple secrets
|
||||
debug:
|
||||
msg:
|
||||
- "{{ lookup('onepassword', 'op://vault/item1/field') }}"
|
||||
- "{{ lookup('onepassword', 'op://vault/item2/field') }}"
|
||||
- "{{ lookup('my_1password', 'op://vault/item1/field') }}"
|
||||
- "{{ lookup('my_1password', 'op://vault/item2/field') }}"
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = """
|
||||
name: onepassword
|
||||
name: my_1password
|
||||
author: Menno
|
||||
version_added: "1.0"
|
||||
short_description: fetch secrets from 1Password
|
||||
@@ -17,15 +17,15 @@ DOCUMENTATION = """
|
||||
EXAMPLES = """
|
||||
- name: fetch password using 1Password reference
|
||||
debug:
|
||||
msg: "{{ lookup('onepassword', 'op://vault/item/password') }}"
|
||||
msg: "{{ lookup('my_1password', 'op://vault/item/password') }}"
|
||||
|
||||
- name: fetch username from item
|
||||
debug:
|
||||
msg: "{{ lookup('onepassword', 'op://vault/item/username') }}"
|
||||
msg: "{{ lookup('my_1password', 'op://vault/item/username') }}"
|
||||
|
||||
- name: fetch custom field
|
||||
debug:
|
||||
msg: "{{ lookup('onepassword', 'op://vault/item/custom_field') }}"
|
||||
msg: "{{ lookup('my_1password', 'op://vault/item/custom_field') }}"
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
Reference in New Issue
Block a user