-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path40976.yml
55 lines (49 loc) · 1.36 KB
/
40976.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
- hosts: localhost
gather_facts: no
connection: local
vars:
RG: ansibletest678
OID: 12345678-9e4f-456c-bc3b-123456789012
TENANT: 12345678-5955-41ca-99cc-123456789012
OBJECTID: {}
VAULT: AnsibleTestVault6789
tasks:
- name: "Create key vault"
azure_rm_keyvault:
resource_group: "{{ RG }}"
vault_name: "{{ VAULT }}"
enabled_for_deployment: yes
vault_tenant: "{{ TENANT }}"
sku:
name: standard
family: A
access_policies:
- object_id: "{{ OID }}"
keys:
- get
- list
- update
- create
- import
- delete
- recover
- backup
- restore
secrets:
- get
- list
- set
- delete
- recover
- backup
- restore
# THIS WORKS
- name: "Populate the key vault (DbConnectionString), calling into AZ"
block:
- command: "az keyvault secret set --name DbConnectionString --value ABC --vault-name {{ VAULT }}"
# THIS FAILS
- name: Create a secret the ansible way
azure_rm_keyvaultsecret:
secret_name: DbConnectionString2
secret_value: DEF
keyvault_uri: "https://{{ VAULT }}.vault.azure.net/"