forked from HewlettPackard/oneview-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oneview_logical_interconnect_group.yml
99 lines (93 loc) · 3.54 KB
/
oneview_logical_interconnect_group.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
###
# 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"
# Inform the permitted Interconnect Type URI to configure Interconnect Map
permitted_interconnect_type_name: 'HP VC Flex-10/10D Module'
scope_uris:
- '/rest/scopes/d0324c4b-56c9-485b-b7dd-8f6218a4b5bb'
- '/rest/scopes/9422ce05-dc39-4358-b723-c8c825eae412'
tasks:
- name: Create a Logical Interconnect Group
oneview_logical_interconnect_group:
config: "{{ config }}"
state: present
data:
name: 'Test Logical Interconnect Group'
uplinkSets: []
enclosureType: 'C7000'
interconnectMapTemplate:
interconnectMapEntryTemplates:
- logicalDownlinkUri: ~
logicalLocation:
locationEntries:
- relativeValue: "1"
type: "Bay"
- relativeValue: 1
type: "Enclosure"
permittedInterconnectTypeName: '{{ permitted_interconnect_type_name }}'
# Alternatively you can inform permittedInterconnectTypeUri
delegate_to: localhost
- name: Do nothing with the Logical Interconnect Group when no changes are provided
oneview_logical_interconnect_group:
config: "{{ config }}"
state: present
data:
name: 'Test Logical Interconnect Group'
enclosureType: 'C7000'
delegate_to: localhost
- name: Update the Logical Interconnect Group changing the attribute description to 'New Description'
oneview_logical_interconnect_group:
config: "{{ config }}"
state: present
data:
name: 'Test Logical Interconnect Group'
description: 'New Description'
delegate_to: localhost
- name: Update the Logical Interconnect Group with two scopes
oneview_logical_interconnect_group:
config: "{{ config }}"
state: present
data:
name: Test Logical Interconnect Group
scopeUris: "{{ scope_uris }}"
delegate_to: localhost
- name: Rename the Logical Interconnect Group to 'Updated Logical Interconnect Group'
oneview_logical_interconnect_group:
config: "{{ config }}"
state: present
data:
name: 'Test Logical Interconnect Group'
newName: 'Updated Logical Interconnect Group'
delegate_to: localhost
- name: Delete the Logical Interconnect Group
oneview_logical_interconnect_group:
config: "{{ config }}"
state: absent
data:
name: 'Updated Logical Interconnect Group'
delegate_to: localhost
register: deleted
- name: Do nothing when the Logical Interconnect Group is absent
oneview_logical_interconnect_group:
config: "{{ config }}"
state: absent
data:
name: 'Updated Logical Interconnect Group'
delegate_to: localhost
register: deleted