forked from HewlettPackard/oneview-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oneview_os_deployment_plan_facts.yml
60 lines (56 loc) · 2.33 KB
/
oneview_os_deployment_plan_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
###
# 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"
- os_deployment_plan_name: "RHEL_7.3"
tasks:
- name: Gather facts about all Os Deployment Plans
oneview_os_deployment_plan_facts:
config: "{{ config }}"
delegate_to: localhost
- debug: var=os_deployment_plans
- name: Gather paginated, filtered and sorted facts about OS Deployment Plans
oneview_os_deployment_plan_facts:
config: "{{ config }}"
params:
start: 0
count: 3
sort: name:ascending
filter: deploymentApplianceIpv4='15.212.171.216'
delegate_to: localhost
- debug: var=os_deployment_plans
- name: Gather facts about an Os Deployment Plan by name
oneview_os_deployment_plan_facts:
config: "{{ config }}"
name: "{{os_deployment_plan_name}}"
delegate_to: localhost
- debug: var=os_deployment_plans
- name: Gather facts about an Os Deployment Plan by name with OS Custom Attributes option
oneview_os_deployment_plan_facts:
config: "{{ config }}"
name: "{{os_deployment_plan_name}}"
options:
# This option will generate an os_deployment_plan_custom_attributes facts in a Server Profile format.
- osCustomAttributesForServerProfile
delegate_to: localhost
- debug: var=os_deployment_plans
- debug: var=os_deployment_plan_custom_attributes
# Copy contents of the fact to a local file, allowing the user to edit it
- name: "Exporting OS Custom Attributes to a file: {{ playbook_dir }}/vars/os_attributes.yaml"
copy: content="{{ os_deployment_plan_custom_attributes | to_nice_yaml }}" dest="{{ playbook_dir }}/vars/os_attributes.yaml"
delegate_to: localhost