forked from HewlettPackard/oneview-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoneview_server_profile_facts.yml
110 lines (97 loc) · 4.16 KB
/
oneview_server_profile_facts.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
###
# 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"
# set the name of an existent server profile to run this example
server_profile_name: "Demo Server Profile"
# set the uri of an existent enclosure group to run this example
enclosure_group_uri: '/rest/enclosure-groups/3af25c76-dec7-4753-83f6-e1ad06c29a43'
# set the uri of an existent server hardware type to run this example
server_hardware_type_uri: '/rest/server-hardware-types/C8DEF9A6-9586-465E-A951-3070988BC226'
# set the ID of an existent storage system to run this example
storage_system_id: "TXQ1010307"
tasks:
- name: Gather facts about all Server Profiles
oneview_server_profile_facts:
config: "{{ config }}"
delegate_to: localhost
- debug: msg="{{server_profiles | map(attribute='name') | list }}"
- debug: var=server_profiles
- name: Gather paginated, filtered and sorted facts about Server Profiles
oneview_server_profile_facts:
config: "{{ config }}"
params:
start: 0
count: 3
sort: name:ascending
filter: macType='Virtual'
delegate_to: localhost
- debug: msg="{{server_profiles | map(attribute='name') | list }}"
- name: Gather facts about a Server Profile by name
oneview_server_profile_facts:
config: "{{ config }}"
name: "{{server_profile_name}}"
delegate_to: localhost
- debug: var=server_profiles
- name: Gather facts about available servers and bays for a given enclosure group and server hardware type
oneview_server_profile_facts:
config: "{{ config }}"
options:
- availableTargets:
serverHardwareTypeUri: "{{server_hardware_type_uri}}"
enclosureGroupUri: "{{enclosure_group_uri}}"
delegate_to: localhost
- debug: var=server_profile_available_targets
- name: Gather all facts about a Server Profile
oneview_server_profile_facts:
config: "{{ config }}"
name : "{{server_profile_name}}"
options:
- schema
- compliancePreview
- profilePorts:
serverHardwareTypeUri: "{{server_hardware_type_uri}}"
enclosureGroupUri: "{{enclosure_group_uri}}"
- messages
- transformation:
serverHardwareTypeUri: "{{server_hardware_type_uri}}"
enclosureGroupUri: "{{enclosure_group_uri}}"
- availableNetworks:
serverHardwareTypeUri: "{{server_hardware_type_uri}}"
enclosureGroupUri: "{{enclosure_group_uri}}"
- availableServers
- availableStorageSystem:
storageSystemId: "{{storage_system_id}}"
serverHardwareTypeUri: "{{server_hardware_type_uri}}"
enclosureGroupUri: "{{enclosure_group_uri}}"
- availableStorageSystems:
serverHardwareTypeUri: "{{server_hardware_type_uri}}"
enclosureGroupUri: "{{enclosure_group_uri}}"
- availableTargets
delegate_to: localhost
- debug: var=server_profiles
- debug: var=server_profile_schema
- debug: var=server_profile_compliance_preview
- debug: var=server_profile_profile_ports
- debug: var=server_profile_messages
- debug: var=server_profile_transformation
- debug: var=server_profile_available_networks
- debug: var=server_profile_available_servers
- debug: var=server_profile_available_storage_system
- debug: var=server_profile_available_storage_systems
- debug: var=server_profile_available_targets