Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an example credential with HashiCorp Vault source #909

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions roles/credential_input_sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ This also speeds up the overall role.
|:---:|:---:|:---:|:---:|:---:|
|`target_credential`|""|yes|str|Name of credential to have the input source applied|
|`input_field_name`|""|yes|str|Name of field which will be written by the input source|
|`source_credential`|""|no|str|Name of the source credential which points to a credential source|
|`source_credential`|""|no|str|Name of the source credential which points to an external secret lookup credential |
|`metadata`|""|no|dict|The metadata applied to the source.|
|`description`|""|no|str|Description to use for the credential input source.|
|`state`|`present`|no|str|Desired state of the resource.|

For further details on fields see <https://docs.ansible.com/automation-controller/latest/html/userguide/credential_plugins.html>
For further details on fields see <https://docs.ansible.com/automation-controller/latest/html/userguide/credential_plugins.html>. The input accepted by the `metadata` field will differ depending on the credential plugin being used.

### Standard Credential Input Source Data Structure

Expand All @@ -101,6 +101,19 @@ For further details on fields see <https://docs.ansible.com/automation-controlle
"object_query_format": "Exact"
},
"description": "Fill the gitlab credential from CyberArk"
},
{
"source_credential": "hashivault",
"target_credential": "gitlab",
"input_field_name": "password",
"metadata": {
"secret_backend": "mykv",
"secret_path": "vault/path/to/gitlab/secret",
"auth_path": "approle",
"secret_key": "GITLAB_PASSWORD_FROM_HASHI_VAULT",
"secret_version": "v2"
},
"description": "Fill the gitlab credential from HashiCorp Vault"
}
]
}
Expand All @@ -111,6 +124,16 @@ For further details on fields see <https://docs.ansible.com/automation-controlle
```yaml
---
controller_credential_input_sources:
- source_credential: hashivault
target_credential: gitlab
input_field_name: password
metadata:
secret_backend: mykv
secret_path: vault/path/to/gitlab/secret
auth_path: approle
secret_key: GITLAB_PASSWORD_FROM_HASHI_VAULT
secret_version
description: Fill the gitlab credential from HashiCorp Vault
- source_credential: cyberark
target_credential: gitlab
input_field_name: password
Expand Down
9 changes: 9 additions & 0 deletions roles/credentials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ controller_credentials:
inputs:
username: person
password: password
- name: hashivault
description: HashiCorp Vault Secret Lookup example using token auth
organization: Default
credential_type: HashiCorp Vault Secret Lookup
inputs:
url: https://vault.example.com:8243
token: token
cacert: "{{ lookup('ansible.builtin.file', '/path/to/ca-certificates.crt') }}"
api_version: v2
- name: localuser
description: Machine Credential example with become_method input
credential_type: Machine
Expand Down
Loading