-
Notifications
You must be signed in to change notification settings - Fork 1
/
99_get_inventory.yml
40 lines (39 loc) · 1.26 KB
/
99_get_inventory.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
# Example Playbook to configure PPDM Certificates
- name: Get PPDM Inventory Sources
hosts: localhost
gather_facts: no
connection: local
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 inventory-sources
include_role:
name: get_ppdm_inventory-sources
vars:
filter: "{{ inventory_filter | default('') }}"
id: "{{ inventory_id | default('') }}"
- debug:
msg: "{{ inventorysources | json_query('[*].{name: name,id: id,type: type}') }}"
verbosity: 0
- name: inventorysources Result summary
debug:
msg: "{{ inventorysources | json_query('[*].{name: name,id: id,type: type}') }}"
verbosity: 0
when: inventorysources is defined
- name: inventorysource Result
debug:
msg: "{{ inventorysources }}"
verbosity: 0
when: inventorysources is defined and inventory_id is defined