mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
e62c1cd050
* keyvault_operations module init + template * Created KeyVault Secrets Module. No Tests * Passing 2.7/3.x sanity tests * added intergration tests for keyvault secrets noop * integration test pass/need keyvault module * Added az env cleanup to intergration tests * Updated auth to 0.3.6 ver * fixed typo in integration tests * Added check_mode * Added tags * Updated tags test, sanity + integration passed * checked mode * updated tests * fixing sanity * fix copyright
64 lines
No EOL
1.5 KiB
YAML
64 lines
No EOL
1.5 KiB
YAML
- name: Prepare random number
|
|
set_fact:
|
|
rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
|
|
run_once: yes
|
|
|
|
- name: Create instance of Key Vault
|
|
azure_rm_keyvault:
|
|
resource_group: "{{ resource_group }}"
|
|
vault_name: "vault{{ rpfx }}"
|
|
enabled_for_deployment: yes
|
|
vault_tenant: "{{ azure_tenant }}"
|
|
sku:
|
|
name: standard
|
|
family: A
|
|
access_policies:
|
|
- tenant_id: "{{ azure_tenant }}"
|
|
object_id: 97567bfa-cf13-4217-8fa3-cc56bc1867fe
|
|
keys:
|
|
- get
|
|
- list
|
|
- update
|
|
- create
|
|
- import
|
|
- delete
|
|
- recover
|
|
- backup
|
|
- restore
|
|
secrets:
|
|
- get
|
|
- list
|
|
- set
|
|
- delete
|
|
- recover
|
|
- backup
|
|
- restore
|
|
register: output
|
|
|
|
- name: create a kevyault secret
|
|
block:
|
|
- azure_rm_keyvaultsecret:
|
|
keyvault_uri: https://vault{{ rpfx }}.vault.azure.net
|
|
secret_name: testsecret
|
|
secret_value: 'mysecret'
|
|
tags:
|
|
testing: test
|
|
delete: on-exit
|
|
register: output
|
|
- assert:
|
|
that: output.changed
|
|
rescue:
|
|
- azure_rm_keyvaultsecret:
|
|
keyvault_uri: https://vault{{ rpfx }}.vault.azure.net
|
|
state: absent
|
|
secret_name: testsecret
|
|
|
|
- name: delete a kevyault secret
|
|
azure_rm_keyvaultsecret:
|
|
keyvault_uri: https://vault{{ rpfx }}.vault.azure.net
|
|
state: absent
|
|
secret_name: testsecret
|
|
register: output
|
|
|
|
- assert:
|
|
that: output.changed |