-
Notifications
You must be signed in to change notification settings - Fork 1
/
31.1-playbook_get_activities.yml
39 lines (38 loc) · 1.16 KB
/
31.1-playbook_get_activities.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 Activities
hosts: localhost
gather_facts: no
connection: local
vars:
vm_name: 2019.52
vars_files:
- ./vars/main.yml
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
include_role:
name: get_ppdm_activities
vars:
filter: "{{ activity_filter | default('') }}"
id: "{{ activity_id | default('') }}"
- name: Activities Result Short, full result in fact activities
debug:
msg: "{{ activities | json_query('[*].{name: name,id: id,type: type}') }}"
verbosity: 0
when: activities is defined
- name: Activities Result
debug:
msg: "{{ activities }}"
verbosity: 0
when: activities is defined and activity_id is defined