forked from HewlettPackard/oneview-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoneview_san_manager.yml
116 lines (110 loc) · 4.03 KB
/
oneview_san_manager.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
---
- hosts: all
vars:
config: "{{ playbook_dir }}/oneview_config.json"
## To run this sample you must define the following information for a Brocade Network Advisor and a Cisco Switch
# Vars for Brocade Network Advisor
manager_host_brocade: '<san_manager1_host_name_or_ip>'
manager_port_brocade: <san_manager1_port>
manager_username_brocade: '<san_manager1_user_name>'
manager_password_brocade: '<san_manager1_password>'
# Vars for Cisco Switch
manager_host_cisco: '<san_manager2_host_name_or_ip>'
manager_port_cisco: <san_manager2_port>
manager_username_cisco: '<san_manager2_user_name>'
manager_password_cisco: '<san_manager2_password>'
tasks:
- name: Ensure a Device Manager for the Brocade SAN Provider is present
oneview_san_manager:
config: "{{ config }}"
state: present
data:
name: '{{ manager_host_brocade }}'
providerDisplayName: 'Brocade Network Advisor'
connectionInfo:
- name: Host
value: '{{ manager_host_brocade }}'
- name: Port
value: '{{ manager_port_brocade }}'
- name: Username
value: '{{ manager_username_brocade }}'
- name: Password
value: '{{ manager_password_brocade }}'
- name: UseSsl
value: true
delegate_to: localhost
- name: Ensure a Device Manager for the Cisco SAN Provider is present
oneview_san_manager:
config: "{{ config }}"
state: present
data:
name: "{{ manager_host_cisco }}"
providerDisplayName: Cisco
connectionInfo:
- name: Host
value: "{{ manager_host_cisco }}"
- name: SnmpPort
value: "{{ manager_port_cisco }}"
- name: SnmpUserName
value: "{{ manager_username_cisco }}"
- name: SnmpAuthLevel
value: authnopriv
- name: SnmpAuthProtocol
value: sha
- name: SnmpAuthString
value: "{{ manager_password_cisco }}"
delegate_to: localhost
- name: Update the "'{{ manager_host_brocade }}'" SAN Manager
oneview_san_manager:
config: "{{ config }}"
state: connection_information_set
data:
connectionInfo:
- name: Host
value: '{{ manager_host_brocade }}'
- name: Port
value: '{{ manager_port_brocade }}'
- name: Username
value: '{{ manager_username_brocade }}'
- name: Password
value: '{{ manager_password_brocade }}'
- name: UseSsl
value: true
delegate_to: localhost
- name: Refreshes the "'{{ manager_host_brocade }}'" SAN Manager
oneview_san_manager:
config: "{{ config }}"
state: present
data:
name: '{{ manager_host_brocade }}'
refreshState: 'RefreshPending'
delegate_to: localhost
- name: Remove the '{{ manager_host_brocade }}' Brocade SAN Manager
oneview_san_manager:
config: "{{ config }}"
state: absent
data:
name: '{{ manager_host_brocade }}'
delegate_to: localhost
- name: Remove the '{{ manager_host_brocade }}' Cisco SAN Manager
oneview_san_manager:
config: "{{ config }}"
state: absent
data:
name: '{{ manager_host_cisco }}'
delegate_to: localhost