-
Notifications
You must be signed in to change notification settings - Fork 2
/
siphon_method_parameters.yml
38 lines (34 loc) · 1.11 KB
/
siphon_method_parameters.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
---
# Playbook to update attributes in the root object in automate workspace
# This example shows how to set attributes in the root object
# by siphoning method parameters
- hosts: localhost
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: Set the attributes in the root object
uri:
url: "{{ aws_url }}"
method: POST
body:
action: edit
resource: "{ 'objects': { 'root': {{ workspace['json']['input']['method_parameters'] }} }, 'state_vars': {}}"
body_format: json
validate_certs: False
headers:
X-Auth-Token: "{{ manageiq.api_token }}"
Content-Type: "application/json"
status_code: 200
register: output