-
Notifications
You must be signed in to change notification settings - Fork 57
AAP 56066: Add KV1 and Update KV2 Content for Hashi Vault Docs - DON'T BACKPORT UNTIL RELEASED #4908
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
Merged
Merged
AAP 56066: Add KV1 and Update KV2 Content for Hashi Vault Docs - DON'T BACKPORT UNTIL RELEASED #4908
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dcb9055
Add KV1 and update KVr Hasi Vault content
jonquilwilliams 8976b4c
Fix file name
jonquilwilliams e4ce2f1
Fixed formatting in examples
jonquilwilliams 01739d7
Edits from SME comments
jonquilwilliams 4e0a385
Added CQA for additional resources
jonquilwilliams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
downstream/assemblies/vault-aap/assembly-vault-kv1-modules.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| :_mod-docs-content-type: ASSEMBLY | ||
|
|
||
| [id="vault-kv1-modules"] | ||
|
|
||
| = Configuring KV1 modules | ||
|
|
||
| [role="_abstract"] | ||
|
|
||
| If you are using KV1 with `community.hashi_vault` collection, configure the corresponding modules in the `hashicorp.vault` collection. | ||
|
|
||
| include::vault-aap/proc-vault-configuring-kv1-secret.adoc[leveloffset=+1] | ||
| include::vault-aap/proc-vault-configuring-kv1-secret-info.adoc[leveloffset=+1] | ||
| include::vault-aap/proc-vault-configuring-kv1-secret-get-lookup.adoc[leveloffset=+1] | ||
| include::vault-aap/con-vault-migration-examples-kv1-secret-info.adoc[leveloffset=+1] | ||
| include::vault-aap/con-vault-migration-examples-kv1-secret-get-lookup.adoc[leveloffset=+1] |
16 changes: 16 additions & 0 deletions
16
downstream/assemblies/vault-aap/assembly-vault-kv2-modules.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| :_mod-docs-content-type: ASSEMBLY | ||
|
|
||
| [id="vault-kv2-modules"] | ||
|
|
||
| = Configuring KV2 modules | ||
|
|
||
| [role="_abstract"] | ||
|
|
||
| If you are using KV2 with `community.hashi_vault` collection, configure the corresponding modules in the `hashicorp.vault` collection. | ||
|
|
||
| include::vault-aap/proc-vault-configuring-kv2-secret.adoc[leveloffset=+1] | ||
| include::vault-aap/proc-vault-configuring-kv2-secret-info.adoc[leveloffset=+1] | ||
| include::vault-aap/proc-vault-configuring-kv2-secret-get-lookup.adoc[leveloffset=+1] | ||
| include::vault-aap/con-vault-migration-examples-kv2-secret-module.adoc[leveloffset=+1] | ||
| include::vault-aap/con-vault-migration-examples-kv2-secret-info.adoc[leveloffset=+1] | ||
| include::vault-aap/con-vault-migration-examples-kv2-secret-get-lookup.adoc[leveloffset=+1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...tream/modules/vault-aap/con-vault-migration-examples-kv1-secret-get-lookup.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| :_mod-docs-content-type: CONCEPT | ||
|
|
||
| [id="vault-migration-examples-kv1-secret-get-lookup"] | ||
|
|
||
| = Migration example for the `hashicorp.vault.kv1_secret_get` lookup | ||
|
|
||
| [role="_abstract"] | ||
|
|
||
| The following example shows the KV1 secret get lookup. | ||
|
|
||
| **Example:** | ||
|
|
||
| Before (community.hashi_vault) | ||
|
|
||
| ---- | ||
| - name: Retrieve a secret from the Vault | ||
| ansible.builtin.debug: | ||
| msg: "{{ lookup('community.hashi_vault.vault_kv1_get', 'hello', url='https://vault:8201') }}" | ||
| ---- | ||
|
|
||
| After (hashicorp.vault) | ||
| ---- | ||
| - name: Retrieve a secret from the Vault | ||
| ansible.builtin.debug: | ||
| msg: "{{ lookup('hashicorp.vault.kv1_secret_get', | ||
| secret='hello', | ||
| url='https://myvault_url:8201') }}" | ||
| ---- |
34 changes: 34 additions & 0 deletions
34
downstream/modules/vault-aap/con-vault-migration-examples-kv1-secret-info.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| :_mod-docs-content-type: CONCEPT | ||
|
|
||
| [id="vault-migration-examples-kv1-secret-info"] | ||
|
|
||
| = Migration example for the `hashicorp.vault.kv1_secret_info` module | ||
|
|
||
| [role="_abstract"] | ||
|
|
||
| The following example shows before and after configurations for the `hashicorp.vault.kv1_secret_info` module. | ||
|
|
||
| **Example:** | ||
|
|
||
| Before (community.hashi_vault) | ||
|
|
||
| ---- | ||
| - name: Read a kv1 secret from Vault (community collection) | ||
| community.hashi_vault.vault_kv1_get: | ||
| url: https://vault:8201 | ||
| token: "{{ vault_token }}" | ||
| path: hello | ||
| register: response | ||
|
|
||
| ---- | ||
|
|
||
| After (hashicorp.vault) | ||
|
|
||
| ---- | ||
| - name: Read a kv1 secret from Vault (hashicorp.vault collection) | ||
| hashicorp.vault.kv1_secret_info: | ||
| url: https://vault.example.com:8201 | ||
| token: "{{ vault_token }}" | ||
| path: sample | ||
|
|
||
| ---- |
7 changes: 4 additions & 3 deletions
7
...migration-examples-secret-get-lookup.adoc → ...ation-examples-kv2-secret-get-lookup.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
downstream/modules/vault-aap/con-vault-migration-examples-kv2-secret-info.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| :_mod-docs-content-type: CONCEPT | ||
|
|
||
| [id="vault-migration-examples-kv2-secret-info"] | ||
|
|
||
| = Migration examples for the `hashicorp.vault.kv2_secret_info` module | ||
|
|
||
| [role="_abstract"] | ||
|
|
||
| The following examples show before and after configurations for the `hashicorp.vault.kv2_secret_info` module. | ||
|
|
||
| **Example 1: Read a secret with token authentication** | ||
|
|
||
| Before (community.hashi_vault) | ||
|
|
||
| ---- | ||
| - name: Read the latest version of a kv2 secret from Vault community.hashi_vault.vault_kv2_get: | ||
| url: https://vault.example.com:8200 | ||
| token: "{{ vault_token }}" | ||
| path: myapp/config | ||
| register: response | ||
| ---- | ||
|
|
||
| After (hashicorp.vault) | ||
|
|
||
| ---- | ||
| - name: Read a secret with token authentication | ||
| hashicorp.vault.kv2_secret_info: | ||
| url: https://vault.example.com:8200 | ||
| token: "{{ vault_token }}" | ||
| path: myapp/config | ||
| ---- | ||
|
|
||
| **Example 2: Read a secret with a specific version** | ||
|
|
||
| Before (community.hashi.vault) | ||
|
|
||
| ---- | ||
| - name: Read version 5 of a secret from kv2 | ||
| community.hashi_vault.vault_kv2_get: | ||
| url: https://vault.example.com:8200 | ||
| path: myapp/config | ||
| version: 5 | ||
| ---- | ||
|
|
||
| After (hashicorp.vault) | ||
|
|
||
| ---- | ||
| - name: Read a secret with a specific version | ||
| hashicorp.vault.kv2_secret_info: | ||
| url: https://vault.example.com:8200 | ||
| path: myapp/config | ||
| version: 1 | ||
| ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
downstream/modules/vault-aap/proc-vault-configuring-kv1-secret-get-lookup.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| :_mod-docs-content-type: PROCEDURE | ||
|
|
||
| [id="vault-configuring-kv1-secret-get-lookup"] | ||
|
|
||
| = Configuring the `hashicorp.vault.kv1_secret_get` lookup plugin | ||
|
|
||
| [role="_abstract"] | ||
|
|
||
| The `hashicorp.vault.kv1_secret_get` lookup plugin module reads KV1 secrets. | ||
|
|
||
| The corresponding `community.hashi_vault` modules are: | ||
|
|
||
| * **`community.hashi_vault.hashi_vault`:** Retrieves secrets from HashiCorp Vault. | ||
| * **`community.hashi_vault.vault_kv1_get lookup`:** Gets secrets from the HashiCorp Vault KV version 1 secret store. | ||
|
|
||
| .Procedure | ||
| . Replicate `the community.hashi_vault` modules to the following `hashicorp.vault.kv1_secret_get` parameters. | ||
| + | ||
| ---- | ||
| auth_method: | ||
jonquilwilliams marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| description: Authentication method to use. | ||
| choices: ['token', 'approle'] | ||
| default: token | ||
| type: str | ||
| engine_mount_point: | ||
| description: | ||
| - The KV secrets engine mount point. | ||
| default: secret | ||
| type: str | ||
| aliases: ['mount_point', 'secret_mount_path'] | ||
| secret: | ||
| description: | ||
| - The Vault path to the secret being requested. | ||
| required: true | ||
| type: str | ||
| aliases: ['secret_path'] | ||
| ---- | ||
| . (Required) Configure the secret parameter. This maps to secret in the `community.hashi_vault.hashi_vault` modules. *Alias:* `secret_path` | ||
| . If needed, configure the link:https://console.redhat.com/ansible/automation-hub/repo/published/hashicorp/vault/docs/[optional parameters]. | ||
|
|
||
| .Next step | ||
|
|
||
| * {URLHashiGuide}/vault-product#vault-creating-a-credential-type[Creating a credential type] | ||
|
|
||
| [role="_additional-resources"] | ||
| .Additional resources | ||
| * link:{URLHashiGuide}/vault-product#vault-migration-examples-kv1-secret-get-lookup[Migration examples for the `hashicorp.vault.kv1_secret_get` lookup plugin]. | ||
46 changes: 46 additions & 0 deletions
46
downstream/modules/vault-aap/proc-vault-configuring-kv1-secret-info.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| :_mod-docs-content-type: PROCEDURE | ||
|
|
||
| [id="vault-configuring-kv1-secret-info"] | ||
|
|
||
| = Configuring the `hashicorp.vault.kv1_secret_info` module | ||
|
|
||
| [role="_abstract"] | ||
|
|
||
| The `hashicorp.vault.kv1_secret_info` module reads KV1 secrets. | ||
|
|
||
| The corresponding community.hashi_vault modules are: | ||
|
|
||
| * **`community.hashi_vault.vault_kv1_get`:** Retrieves secrets from the HashiCorp Vault KV version 1 secret store. | ||
| * **`community.hashi_vault.vault_kv1_get lookup`:** Retrieves secrets from the HashiCorp Vault KV version 1 secret store. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Replicate the `community.hashi_vault modules` to the following `hashicorp.vault.kv1_secret_secret_info` parameters. | ||
| + | ||
| ---- | ||
| engine_mount_point: | ||
| description: KV secrets engine mount point. | ||
| default: secret | ||
| type: str | ||
| aliases: [secret_mount_path] | ||
| path: | ||
| description: | ||
| - Specifies the path of the secret. | ||
| required: true | ||
| type: str | ||
| aliases: [secret_path] | ||
| extends_documentation_fragment: | ||
| - hashicorp.vault.vault_auth.modules | ||
| ---- | ||
|
|
||
| . (Required) Configure the `path` parameter. This is | ||
| the path to the secret in the `community.hashi_vault.hashi_vault` modules. *Alias:* `secret_path` | ||
| . If needed, configure the link:https://console.redhat.com/ansible/automation-hub/repo/published/hashicorp/vault/docs/[optional parameters]. | ||
|
|
||
| .Next step | ||
|
|
||
| * link:{URLHashiGuide}/vault-product#vault-configuring-kv1-secret-get-lookup[Configuring the `hashicorp.vault.kv1_secret_get` lookup plugin]. | ||
|
|
||
| [role="_additional-resources"] | ||
| .Additional resources | ||
| * link:{URLHashiGuide}/vault-product#vault-migration-examples-kv1-secret-info[Migration examples for the `hashicorp.vault.kv1_secret_info` module]. |
9 changes: 9 additions & 0 deletions
9
downstream/modules/vault-aap/proc-vault-configuring-kv1-secret.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| :_mod-docs-content-type: PROCEDURE | ||
|
|
||
| [id="vault-configuring-kv1-secret"] | ||
|
|
||
| = Configuring the `hashicorp.vault.kv1_secret` module | ||
|
|
||
| [role="_abstract"] | ||
|
|
||
| Configuring this module is not required for migration because there are no corresponding modules in `community.hashi_vault`. However, you might want to configure something other than the defaults for `auth_method` and `state` after the migration. You can use the examples on {HubNameMain} for reference. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.