-
Notifications
You must be signed in to change notification settings - Fork 1
/
1.0-playbook_configure_ppdm.yml
69 lines (67 loc) · 2.49 KB
/
1.0-playbook_configure_ppdm.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
60
61
62
63
64
65
66
67
68
69
# Example Playbok to configure PPSM
- name: Configure PPDM
hosts: localhost
gather_facts: no
connection: local
vars_files:
- ./vars/main.yml
tasks:
- name: Checking Required Variables
fail:
msg: "We do not have ppdm fqdn set !"
when: (ppdm_fqdn is not defined) or (ppdm_fqdn|length <= 8)
- name: Checking Required Variables
fail:
msg: "We do not have ppdm_new_password set !"
when: (ppdm_new_password is not defined) or (ppdm_new_password|length == 0)
- name: Checking Required Variable ppdm_timeZone
fail:
msg: "We do not have ppdm_timeZone set !"
when: (ppdm_timeZone is not defined) or (ppdm_timeZone|length == 0)
- name: Checking Required Variables
fail:
msg: "We do not have ppdm_setup_password set !"
when: (ppdm_setup_password is not defined) or (ppdm_setup_password|length == 0)
- name: Setting Base URL
set_fact:
ppdm_baseurl: "https://{{ ppdm_fqdn | regex_replace('^https://') }}"
- name: Check Appliance Ready https://{{ ppdm_fqdn | regex_replace('^https://') }}
include_role:
name: check_api_ready
- name: Get PPDM Token for https://{{ ppdm_fqdn | regex_replace('^https://') }}
include_role:
name: get_ppdm_token
vars:
ppdm_password: "{{ ppdm_setup_password }}"
- debug:
msg: "{{ access_token }}"
verbosity: 1
name: our do we have a token ?
- name: Accept PPDM EULA
include_role:
name: accept_ppdm_eula
- name: Get PPDM Configuration
include_role:
name: get_ppdm_configuration
- set_fact:
# prior 19.7, we published _links .... new_config: "{% set copy=configuration.content[0].copy() %}{% set removed=copy.pop('_links') %}{{ copy }}"
new_config: "{% set copy=configuration.content[0].copy() %}{{ copy }}"
name: Generating Config from Appliance Config Template using jinja2
- debug:
msg: "{{ new_config }}"
verbosity: 1
- name: Set New Configuration for https://{{ ppdm_fqdn | regex_replace('^https://') }}
include_role:
name: new_ppdm_configuration
vars:
one_password: "{{ ppdm_new_password }}"
ntpServers: "{{ ppdm_ntp_server }}"
timeZone: "{{ ppdm_timeZone }}"
- debug:
msg: "{{ configuration }}"
verbosity: 1
- name: Wait for Configuration finished for Appliance https://{{ ppdm_fqdn | regex_replace('^https://') }}
include_role:
name: wait_ppdm_config_finished
vars:
configuration_id: "{{ new_config.id }}"