Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #315 from HewlettPackard/upgrade/600/enclosure_groups
Browse files Browse the repository at this point in the history
upgrade/600/enclosure_groups
  • Loading branch information
jyothisgm authored Feb 16, 2018
2 parents 39cd150 + fd26b2a commit 00a59a7
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 20 deletions.
4 changes: 2 additions & 2 deletions examples/oneview_enclosure_group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
state: present
data:
name: "Enclosure Group 1"
stackingMode: "Enclosure"
stackingMode: "Enclosure" # Not supported in V600
interconnectBayMappings:
- interconnectBay: 1
- interconnectBay: 2
Expand All @@ -43,7 +43,7 @@
state: present
data:
name: "Enclosure Group 1"
stackingMode: "Enclosure"
stackingMode: "Enclosure" # Not supported in V600
interconnectBayMappings:
- interconnectBay: 1
- interconnectBay: 2
Expand Down
2 changes: 2 additions & 0 deletions examples/oneview_enclosure_group_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
vars:
- config: "{{ playbook_dir }}/oneview_config.json"
- name: "Enclosure Group 1"
- scope_uris: "/rest/scopes/cd237b60-09e2-45c4-829e-082e318a6d2a"
tasks:
- name: Gather facts about all Enclosure Groups
oneview_enclosure_group_facts:
Expand All @@ -34,6 +35,7 @@
count: 3
sort: 'name:descending'
filter: 'status=OK'
scope_uris: '{{ scope_uris }}'

- debug: var=enclosure_groups

Expand Down
19 changes: 14 additions & 5 deletions library/oneview_enclosure_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
version_added: "2.3"
requirements:
- "python >= 2.7.9"
- "hpOneView >= 3.1.0"
- "hpOneView >= 4.5.0"
author: "Gustavo Hennig (@GustavoHennig)"
options:
state:
Expand All @@ -50,11 +50,14 @@
EXAMPLES = '''
- name: Ensure that Enclosure Group is present using the default configuration
oneview_enclosure_group:
config: "{{ config_file_name }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
state: present
data:
name: "Enclosure Group 1"
stackingMode: "Enclosure"
stackingMode: "Enclosure" # Not supported in V600
interconnectBayMappings:
- interconnectBay: 1
- interconnectBay: 2
Expand All @@ -68,7 +71,10 @@
- name: Update the Enclosure Group changing the name attribute
oneview_enclosure_group:
config: "{{ config_file_name }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
state: present
data:
name: "Enclosure Group 1"
Expand All @@ -77,7 +83,10 @@
- name: Ensure that Enclosure Group is absent
oneview_enclosure_group:
config: "{{ config_file_name }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
state: absent
data:
name: "Enclosure Group 1 (renamed)"
Expand Down
18 changes: 14 additions & 4 deletions library/oneview_enclosure_group_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
version_added: "2.3"
requirements:
- "python >= 2.7.9"
- "hpOneView >= 2.0.1"
- "hpOneView >= 4.5.0"
author:
- "Gustavo Hennig (@GustavoHennig)"
- "Bruno Souza (@bsouza)"
Expand All @@ -53,25 +53,35 @@
EXAMPLES = '''
- name: Gather facts about all Enclosure Groups
oneview_enclosure_group_facts:
config: "{{ config_file_path }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
delegate_to: localhost
- debug: var=enclosure_groups
- name: Gather paginated, filtered and sorted facts about Enclosure Groups
oneview_enclosure_group_facts:
config: "{{ config }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
params:
start: 0
count: 3
sort: 'name:descending'
filter: 'status=OK'
scope_uris: '/rest/scopes/cd237b60-09e2-45c4-829e-082e318a6d2a'
- debug: var=enclosure_groups
- name: Gather facts about an Enclosure Group by name with configuration script
oneview_enclosure_group_facts:
config: "{{ config_file_path }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
name: "Test Enclosure Group Facts"
options:
- configuration_script
Expand Down
37 changes: 28 additions & 9 deletions oneview-ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -2288,7 +2288,7 @@ Manage OneView Enclosure Group resources.

#### Requirements (on the host that executes the module)
* python >= 2.7.9
* hpOneView >= 3.1.0
* hpOneView >= 4.5.0

#### Options

Expand All @@ -2306,11 +2306,14 @@ Manage OneView Enclosure Group resources.
- name: Ensure that Enclosure Group is present using the default configuration
oneview_enclosure_group:
config: "{{ config_file_name }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
state: present
data:
name: "Enclosure Group 1"
stackingMode: "Enclosure"
stackingMode: "Enclosure" # Not supported in V600
interconnectBayMappings:
- interconnectBay: 1
- interconnectBay: 2
Expand All @@ -2324,7 +2327,10 @@ Manage OneView Enclosure Group resources.
- name: Update the Enclosure Group changing the name attribute
oneview_enclosure_group:
config: "{{ config_file_name }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
state: present
data:
name: "Enclosure Group 1"
Expand All @@ -2333,7 +2339,10 @@ Manage OneView Enclosure Group resources.
- name: Ensure that Enclosure Group is absent
oneview_enclosure_group:
config: "{{ config_file_name }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
state: absent
data:
name: "Enclosure Group 1 (renamed)"
Expand Down Expand Up @@ -2370,7 +2379,7 @@ Retrieve facts about one or more of the OneView Enclosure Groups.

#### Requirements (on the host that executes the module)
* python >= 2.7.9
* hpOneView >= 2.0.1
* hpOneView >= 4.5.0

#### Options

Expand All @@ -2389,25 +2398,35 @@ Retrieve facts about one or more of the OneView Enclosure Groups.
- name: Gather facts about all Enclosure Groups
oneview_enclosure_group_facts:
config: "{{ config_file_path }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
delegate_to: localhost
- debug: var=enclosure_groups
- name: Gather paginated, filtered and sorted facts about Enclosure Groups
oneview_enclosure_group_facts:
config: "{{ config }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
params:
start: 0
count: 3
sort: 'name:descending'
filter: 'status=OK'
scope_uris: '/rest/scopes/cd237b60-09e2-45c4-829e-082e318a6d2a'
- debug: var=enclosure_groups
- name: Gather facts about an Enclosure Group by name with configuration script
oneview_enclosure_group_facts:
config: "{{ config_file_path }}"
hostname: 172.16.101.48
username: administrator
password: my_password
api_version: 600
name: "Test Enclosure Group Facts"
options:
- configuration_script
Expand Down

0 comments on commit 00a59a7

Please sign in to comment.