-
Notifications
You must be signed in to change notification settings - Fork 2
/
decrypt_obj_attribute.yml
59 lines (54 loc) · 1.72 KB
/
decrypt_obj_attribute.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
56
57
58
59
---
# Playbook to update attributes in the root object in automate workspace
# This example shows how to set a Automate Retry and also allows you
# to preserve state attributes
# You can pass in extra vars to control the automate_workspace
- hosts: localhost
vars:
encrypted_attrs: { 'object': 'root', 'attribute': 'elmst' }
method_attrs: { 'object': 'method_parameters', 'attribute': 'password' }
tasks:
- name: Set the automate workspace url
set_fact:
aws_url: "{{ manageiq.api_url }}/api/{{ manageiq.automate_workspace }}"
- name: Fetch the Workspace
uri:
url: "{{ aws_url }}"
method: GET
validate_certs: False
headers:
X-Auth-Token: "{{ manageiq.api_token }}"
Content-Type: "application/json"
status_code: 200
register: workspace
- debug: var=workspace
- name: Get the decrypted object attribute
uri:
url: "{{ aws_url }}"
method: POST
body:
action: decrypt
resource: "{{ encrypted_attrs }}"
body_format: json
validate_certs: False
headers:
X-Auth-Token: "{{ manageiq.api_token }}"
Content-Type: "application/json"
status_code: 200
register: result
- debug: var=result.json.value
- name: Get the decrypted method parameter
uri:
url: "{{ aws_url }}"
method: POST
body:
action: decrypt
resource: "{{ method_attrs }}"
body_format: json
validate_certs: False
headers:
X-Auth-Token: "{{ manageiq.api_token }}"
Content-Type: "application/json"
status_code: 200
register: result
- debug: var=result.json.value