-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcreate_profile_templates.yml
89 lines (88 loc) · 3.24 KB
/
create_profile_templates.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
###
# Copyright (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 }}/config.json"
server_profile_template_name: "ProfileTemplateTest1"
server_hardware_type_name: "BL460c Gen8 1"
enclosure_group_name: "EG-EcoSystem"
tasks:
- name: Create a basic connection-less server profile template
oneview_server_profile_template:
config: "{{ config }}"
state: present
data:
name: "{{ server_profile_template_name }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
delegate_to: localhost
- name: Update bootMode from recently created template
oneview_server_profile_template:
config: "{{ config }}"
state: present
data:
name: "{{ server_profile_template_name }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
bootMode:
manageMode: True
pxeBootPolicy: Auto
mode: "UEFI"
delegate_to: localhost
- name: Create Connections for recently created templates
oneview_server_profile_template:
config: "{{ config }}"
state: present
data:
name: "{{ server_profile_template_name }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
connections:
- id: 1
name: "DeployNet-A"
functionType: Ethernet
portId: Auto
requestedMbps: 2500
networkUri: "/rest/ethernet-networks/85c2ff96-73c9-4cf5-93e7-4316c56d07a8"
boot:
- id: 2
name: "Management-a"
functionType: Ethernet
portId: Auto
requestedMbps: 2500
networkUri: "/rest/ethernet-networks/8a508330-e21b-48cf-ae71-600128738147"
boot:
delegate_to: localhost
- name: Create logicalDrives for recently created templates
oneview_server_profile_template:
config: "{{ config }}"
state: present
data:
name: "{{ server_profile_template_name }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
localStorage:
controllers:
- deviceSlot: Embedded
mode: RAID
initialize: false
logicalDrives:
- name: Operating System
raidLevel: RAID1
numPhysicalDrives: 2
driveTechnology:
delegate_to: localhost