Some checks failed
Nix Format Check / check-format (push) Failing after 37s
40 lines
1.0 KiB
Markdown
40 lines
1.0 KiB
Markdown
# Ansible Configuration
|
|
|
|
## 1Password Integration
|
|
|
|
This Ansible configuration includes a custom lookup plugin for fetching secrets from 1Password.
|
|
The 1Password CLI must be installed and authenticated on the machine running Ansible.
|
|
|
|
### Usage
|
|
|
|
```yaml
|
|
# Simple password lookup
|
|
password: "{{ lookup('onepassword', 'item-name') }}"
|
|
|
|
# Fetch specific field
|
|
api_key: "{{ lookup('onepassword', 'item-name', field='api_key') }}"
|
|
|
|
# Fetch from specific vault (using vault ID)
|
|
database_password: "{{ lookup('onepassword', 'database', field='password', vault='j7nmhqlsjmp2r6umly5t75hzb4') }}"
|
|
|
|
# Fetch a field without revealing it (for non-password fields)
|
|
note: "{{ lookup('onepassword', 'item-name', field='notes', reveal=false) }}"
|
|
```
|
|
|
|
### Prerequisites
|
|
|
|
1. Install 1Password CLI
|
|
2. Sign in to 1Password using `op signin`
|
|
3. Service account should be properly configured
|
|
|
|
### Finding Vault IDs
|
|
|
|
To find your vault ID:
|
|
|
|
```bash
|
|
op vault list
|
|
```
|
|
|
|
For more information, see the [1Password CLI documentation](https://developer.1password.com/docs/cli).
|
|
```
|