-
Notifications
You must be signed in to change notification settings - Fork 0
/
30.0-playbook_get_assets.yml
38 lines (38 loc) · 1.17 KB
/
30.0-playbook_get_assets.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
# Example Playbook to configure query PPDM Server Disaster Recovery
- name: Get PPDM Assets
hosts: localhost
gather_facts: no
connection: local
vars_files:
- ./vars/main.yml
vars:
full_output: false
tasks:
- name: Setting Base URL
set_fact:
ppdm_baseurl: "https://{{ ppdm_fqdn | regex_replace('^https://') }}"
- name: Get PPDM Token for https://{{ ppdm_fqdn | regex_replace('^https://') }}
include_role:
name: get_ppdm_token
vars:
ppdm_password: "{{ ppdm_new_password }}"
- debug:
msg: "{{ access_token }}"
verbosity: 1
name: do we have a token ?
- name: Get PPDM Assets
vars:
filter: "{{ asset_filter | regex_replace(\"'\", '\"') | default('') }}"
id: "{{ asset_id | default('')}}"
include_role:
name: get_ppdm_assets
- name: Assets Result
debug:
msg: "{{ assets | json_query('[*].{name: name,id: id,type: type,protectionStatus: protectionStatus }') }}"
verbosity: 0
when: assets is defined
- name: Assets Result
debug:
msg: "{{ assets }}"
verbosity: 0
when: assets is defined and ( asset_id is defined or full_output == 'true' )