-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.0-Playbook-configure-initial-network.yml
66 lines (66 loc) · 2.52 KB
/
1.0-Playbook-configure-initial-network.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
# Example Playbok to configure PPDD
- name: Playbook to configure DataDomain for PPDM
hosts: localhost
gather_facts: no
connection: local
vars_files:
- ./vars/main.yml
tasks:
- name: Checking if PPDD FQDN / IP is set
fail:
msg: "We do not have ppdd fqdn set !"
when: (ppdd_fqdn is not defined) or (ppdd_fqdn|length <= 8)
- name: Checking ppdd_username is set
fail:
msg: "We do not have ppdd_username set! Check vars/main.yml for assignment from env vars"
when: (ppdd_username is not defined) or (ppdd_username|length == 0)
- name: Checking PPDD_PASSWORD is set
fail:
msg: "We do not have ppdd_password set ! Check vars/main.yml for assignment from env vars"
when: (ppdd_password is not defined) or (ppdd_password|length == 0)
- name: Checking PPDD_ADDRESS
fail:
msg: "We do not have ppdd_address set ! Check vars/main.yml for assignment from env vars"
when: (ppdd_address is not defined) or (ppdd_address|length == 0)
- name: Checking PPDD_NETMASK
fail:
msg: "We do not have ppdd_netmask set ! Check vars/main.yml for assignment from env vars"
when: (ppdd_netmask is not defined) or (ppdd_netmask|length == 0)
- name: Checking PPDD_GATEWAY
fail:
msg: "We do not have ppdd_gateway set ! Check vars/main.yml for assignment from env vars"
when: (ppdd_gateway is not defined) or (ppdd_gateway|length == 0)
- name: Setting Base URL
set_fact:
ppdd_baseurl: "{{ ppdd_fqdn }}"
- name: Check DataDomain Appliance Ready {{ ppdd_fqdn }}
include_role:
name: wait_ppdd_api_ready
- debug:
msg: "{{ result }}"
verbosity: 1
- name: Get PPDD Token for {{ ppdd_fqdn }}
vars:
status_code: 201,500 #,401
username: "{{ ppdd_username }}"
password: "{{ ppdd_initial_password }}"
include_role:
name: get_ppdd_token
- debug:
msg: "{{ access_token }}"
verbosity: 1
- name: Set PPDD Initial Gateway
vars:
gateway: "{{ ppdd_gateway }}"
status_code: 200,-1 # we accept failure here for subsequent run
include_role:
name: set_ppdd_networks_gateways
- name: Set PPDD Initial IP Address {{ ppdd_fqdn }}
vars:
interface: "ethV0"
dhcp: "NO"
address: "{{ ppdd_address }}"
netmask: "{{ ppdd_netmask }}"
status_code: 200,500,400,-1 # we accept failure here for subsequent run
include_role:
name: set_ppdd_networks_interfaces