forked from HewlettPackard/oneview-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oneview_sas_logical_interconnect.yml
80 lines (74 loc) · 3.24 KB
/
oneview_sas_logical_interconnect.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
###
# 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.
###
---
# This resource is only available on HPE Synergy
- hosts: all
vars:
config: "{{ playbook_dir }}/oneview_config.json"
# Set the names of 2 SAS Logical Interconnects to run the playbook
sas_logical_interconnect_name_1: 'LOG_EN-LIG_SAS-1'
sas_logical_interconnect_name_2: 'LOG_EN-LIG_SAS-2'
# Set the URIs of 2 SAS Logical Interconnects to run the playbook
sas_logical_interconnect_uri_1: '/rest/sas-logical-interconnects/16b2990f-944a-449a-a78f-004d8b4e6824'
sas_logical_interconnect_uri_2: '/rest/sas-logical-interconnects/c800b2e4-92bb-44fa-8a46-f71d40737fa5'
# Set the SPP filename to install it
# firmware_driver_name: 'SPPgen9snap6_2016_0405_87'
tasks:
- name: Update the configuration on the SAS Logical Interconnect
oneview_sas_logical_interconnect:
config: "{{ config }}"
state: configuration_updated
data:
name: "{{ sas_logical_interconnect_name_1 }}"
delegate_to: localhost
- name: Install a firmware to the SAS Logical Interconnect, running the stage operation to upload the firmware
oneview_sas_logical_interconnect:
config: "{{ config }}"
state: firmware_updated
data:
name: "{{ sas_logical_interconnect_name_1 }}"
firmware:
command: Stage
sppName: "{{ firmware_driver_name }}"
# Can be either the firmware name with "sppName" or the uri with "sppUri", e.g.:
# sppUri: '/rest/firmware-drivers/<filename>'
when: firmware_driver_name is defined
delegate_to: localhost
- name: Replace drive enclosure
oneview_sas_logical_interconnect:
config: "{{ config }}"
state: drive_enclosure_replaced
data:
name: "{{ sas_logical_interconnect_name_1 }}"
replace_drive_enclosure:
oldSerialNumber: "S46016710000J4524YPT"
newSerialNumber: "S46016710001J4524YPT"
when: replace_drive_enclosure is defined
delegate_to: localhost
- name: Return a SAS Logical Interconnect list to a consistent state by its names
oneview_sas_logical_interconnect:
config: "{{ config }}"
state: compliant
data:
logicalInterconnectNames: ["{{ sas_logical_interconnect_name_1 }}", "{{ sas_logical_interconnect_name_2 }}"]
delegate_to: localhost
- name: Return a SAS Logical Interconnect list to a consistent state by its URIs
oneview_sas_logical_interconnect:
config: "{{ config }}"
state: compliant
data:
logicalInterconnectUris: ["{{ sas_logical_interconnect_uri_1 }}", "{{ sas_logical_interconnect_uri_2 }}"]
delegate_to: localhost