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

azure_rm_keyvaultsecret secret recovery failing #1809

Open
markatdxb opened this issue Jan 20, 2025 · 1 comment · May be fixed by #1810
Open

azure_rm_keyvaultsecret secret recovery failing #1809

markatdxb opened this issue Jan 20, 2025 · 1 comment · May be fixed by #1810
Labels
enhancement New feature or request has_pr PR fixes have been made medium_priority Medium priority

Comments

@markatdxb
Copy link

SUMMARY

Azure KV secret module should be able to recover deleted secret but throwing error instead
Basically following the module example:

- name: Recover a delete secret
  azure_rm_keyvaultsecret:
    secret_name: MySecret
    keyvault_uri: https://contoso.vault.azure.net/
    recover_if_need: true

Process tested in Postman with the same access credentials is able to recover the secret

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure.azcollection.azure_rm_keyvaultsecret

ANSIBLE VERSION
2.17.7
COLLECTION VERSION
Collection         Version
------------------ -------
azure.azcollection 3.1.0
CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE
    - name: Recover deleted secret
      azure.azcollection.azure_rm_keyvaultsecret:
        cert_validation_mode: validate
        client_id: "{{ az_client_id }}"
        secret: "{{ az_client_secret }}"
        tenant: "{{ az_tenant_id }}"
        subscription_id: "{{ az_subscription_id }}"
        secret_name: MT-TEST03
        keyvault_uri: "{{ az_vault_uri }}"
        recover_if_need: true
EXPECTED RESULTS

Secret MT-TEST03 recovered

ACTUAL RESULTS

error in task execution

fatal: [localhost]: FAILED! => {"changed": false, "msg": "state is present but all of the following are missing: secret_value"}
@Fred-sun Fred-sun linked a pull request Jan 20, 2025 that will close this issue
@Fred-sun
Copy link
Collaborator

@markatdxb This is a constraint made in the module that I removed in #1810. Thank you!

@Fred-sun Fred-sun added enhancement New feature or request has_pr PR fixes have been made medium_priority Medium priority labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request has_pr PR fixes have been made medium_priority Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants