Skip to content

Commit

Permalink
Merge pull request #78 from HewlettPackard/ov6.0_validation
Browse files Browse the repository at this point in the history
ov60_validation
  • Loading branch information
SHANDCRUZ authored Mar 9, 2021
2 parents a27e7cb + 691ef5a commit c0bc18a
Show file tree
Hide file tree
Showing 39 changed files with 168 additions and 77 deletions.
8 changes: 8 additions & 0 deletions playbooks/automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@
- hpe.oneview.oneview_network_set
- hpe.oneview.oneview_network_set_facts
- hpe.oneview.oneview_appliance_configuration_timeconfig_facts
- hpe.oneview.oneview_appliance_device_read_community
- hpe.oneview.oneview_appliance_device_read_community_facts
- hpe.oneview.oneview_appliance_ssh_access_facts
- hpe.oneview.oneview_appliance_ssh_access
- hpe.oneview.oneview_appliance_time_and_locale_configuration_facts
- hpe.oneview.oneview_appliance_time_and_locale_configuration
- hpe.oneview.oneview_appliance_device_snmp_v1_trap_destinations
- hpe.oneview.oneview_appliance_device_snmp_v1_trap_destinations_facts
- hpe.oneview.oneview_appliance_device_snmp_v3_trap_destinations
- hpe.oneview.oneview_appliance_device_snmp_v3_trap_destinations_facts
- hpe.oneview.oneview_appliance_device_snmp_v3_users
- hpe.oneview.oneview_appliance_device_snmp_v3_users_facts
- hpe.oneview.oneview_connection_template
- hpe.oneview.oneview_connection_template_facts
- hpe.oneview.oneview_certificates_server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self):
def execute_module(self):
appliance_time_and_locale_configuration = self.resource_client.get_all()
return dict(changed=False,
ansible_facts=dict(appliance_time_and_locale_configuration=appliance_time_and_locale_configuration))
ansible_facts=dict(appliance_time_and_locale_configuration=appliance_time_and_locale_configuration.data))


def main():
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/oneview_id_pools_ipv4_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def execute_module(self):
self.current_resource = self.resource_client.get_by_uri(self.data.get('uri'))
# Do preliminary check before creating a new range
elif self.data.get('subnetUri') and self.data.get('name'):
subnet = self.oneview_client.id_pools_ipv4_subnets.get(self.data.get('subnetUri'))
for range_uri in subnet['rangeUris']:
subnet = self.oneview_client.id_pools_ipv4_subnets.get_by_uri(self.data.get('subnetUri'))
for range_uri in subnet.data['rangeUris']:
maybe_resource = self.resource_client.get_by_uri(range_uri)
if maybe_resource.data['name'] == self.data['name']:
self.current_resource = maybe_resource
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/oneview_id_pools_ipv4_range_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,16 @@ def execute_module(self):
if self.module.params.get('uri'):
id_pools_ipv4_ranges = self.resource_client.get_by_uri(self.module.params['uri']).data
elif self.module.params.get('subnetUri'):
subnet = self.oneview_client.id_pools_ipv4_subnets.get(self.module.params.get('subnetUri'))
subnet = self.oneview_client.id_pools_ipv4_subnets.get_by_uri(self.module.params.get('subnetUri'))
if self.module.params.get('name'):
for range_uri in subnet['rangeUris']:
for range_uri in subnet.data['rangeUris']:
maybe_resource = self.resource_client.get_by_uri(range_uri).data
if maybe_resource['name'] == self.module.params.get('name'):
id_pools_ipv4_ranges = maybe_resource
break
else:
is_specific_resource = False
for range_uri in subnet['rangeUris']:
for range_uri in subnet.data['rangeUris']:
id_pools_ipv4_ranges.append(self.resource_client.get_by_uri(range_uri).data)
else:
is_specific_resource = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
"api_version": 2600,
"variant": "Synergy"
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# defaults file for oneview_appliance_device_snmp_v3_trap_destination
config: "~/.ansible/collections/ansible_collections/hpe/oneview/roles/oneview_appliance_device_snmp_v3_trap_destination/files/oneview_config.json"
destination_address: "<ip_address>"
username1: "testuser1"
username2: "testuser2"
destination_address: "1.1.1.1"
username1: "user123456"
username2: "test2"
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,14 @@
state: absent
name: "{{ destination_address }}"
delegate_to: localhost

- name: Creating the SNMPv3 Trap Destination for automation
oneview_appliance_device_snmp_v3_trap_destinations:
config: "{{ config }}"
state: present
name: "{{ destination_address }}"
data:
destinationAddress: "{{ destination_address }}"
port: 162
userName: "{{ username1 }}"
delegate_to: localhost
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
config: "{{ config }}"
uri: "{{ appliance_device_snmp_v3_trap_destinations['uri'] }}"
delegate_to: localhost
when: appliance_device_snmp_v3_trap_destinations == True

- debug:
var: appliance_device_snmp_v3_trap_destinations
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"ip": "<ip>",
"credentials": {
"userName": "<userName>",
"password": "<password>"
},
"image_streamer_ip": "",
"api_version": 2600,
"variant": "Synergy"
}

"ip": "<oneview_ip>",
"credentials": {
"userName": "<userName>",
"password": "<password>"
},
"image_streamer_ip": "",
"api_version": 2600,
"variant": "Synergy"
}
22 changes: 21 additions & 1 deletion roles/oneview_appliance_device_snmp_v3_users/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,24 @@
name: "{{ user_name }}"
data:
userName: "{{ user_name }}"
delegate_to: localhost
delegate_to: localhost

- name: Creating the SNMPv3 user for automation
oneview_appliance_device_snmp_v3_users:
config: "{{ config }}"
state: present
name: "user123456"
data:
type: "Users"
userName: "user123456"
delegate_to: localhost

- name: Creating another SNMPv3 user for automation
oneview_appliance_device_snmp_v3_users:
config: "{{ config }}"
state: present
name: "test2"
data:
type: "Users"
userName: "test2"
delegate_to: localhost
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
config: "{{ config }}"
uri: "{{ appliance_device_snmp_v3_users['uri'] }}"
delegate_to: localhost
when: appliance_device_snmp_v3_users == True

- debug:
var: appliance_device_snmp_v3_users
var: appliance_device_snmp_v3_users
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
"api_version": 2600,
"variant": "Synergy"
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
"api_version": 2600,
"variant": "Synergy"
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
"api_version": 2600,
"variant": "Synergy"
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
"api_version": 2600,
"variant": "Synergy"
}

10 changes: 10 additions & 0 deletions roles/oneview_enclosure/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
type: '{{ certificate_data.type }}'
base64Data: '{{ certificate_data.base64Data }}'
delegate_to: localhost
ignore_errors: true

# This state is only available for C7000 enclosures
- name: Set the supportDataCollectionState equals to 'PendingCollection' for the enclosure
Expand Down Expand Up @@ -259,6 +260,7 @@
bayNumber: 1
when: variant == 'Synergy'
delegate_to: localhost
ignore_errors: true
register: result
- debug: var=result.msg
when: variant == 'Synergy'
Expand All @@ -274,6 +276,7 @@
bayNumber: 2
when: variant == 'Synergy'
delegate_to: localhost
ignore_errors: true
register: result
- debug: var=result.msg
when: variant == 'Synergy'
Expand All @@ -289,6 +292,7 @@
bayNumber: 1
when: variant == 'Synergy'
delegate_to: localhost
ignore_errors: true
register: result
- debug: var=result.msg
when: variant == 'Synergy'
Expand All @@ -304,6 +308,7 @@
bayNumber: 10
when: variant == 'Synergy'
delegate_to: localhost
ignore_errors: true
register: result
- debug: var=result.msg
when: variant == 'Synergy'
Expand All @@ -319,6 +324,7 @@
bayNumber: 11
when: variant == 'Synergy'
delegate_to: localhost
ignore_errors: true
register: result
- debug: var=result.msg
when: variant == 'Synergy'
Expand All @@ -334,6 +340,7 @@
bayNumber: 3
when: variant == 'Synergy'
delegate_to: localhost
ignore_errors: true
register: result
- debug: var=result.msg
when: variant == 'Synergy'
Expand All @@ -349,6 +356,7 @@
bayNumber: 2
when: variant == 'Synergy'
delegate_to: localhost
ignore_errors: true
register: result
- debug: var=result.msg
when: variant == 'Synergy'
Expand All @@ -364,6 +372,7 @@
bayNumber: 3
when: variant == 'Synergy'
delegate_to: localhost
ignore_errors: true
register: result
- debug: var=result.msg
when: variant == 'Synergy'
Expand All @@ -379,6 +388,7 @@
bayNumber: 6
when: variant == 'Synergy'
delegate_to: localhost
ignore_errors: true
register: result
- debug: var=result.msg
when: variant == 'Synergy'
Expand Down
2 changes: 1 addition & 1 deletion roles/oneview_enclosure_group_facts/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (2016-2020) Hewlett Packard Enterprise Development LP
Copyright (2016-2021) 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.
Expand Down
2 changes: 2 additions & 0 deletions roles/oneview_enclosure_group_facts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
sort: 'name:descending'
filter: 'status=OK'
scope_uris: "{{ scopes[0]['uri'] }}"
delegate_to: localhost
when: scopes == True

- debug: var=enclosure_groups

Expand Down
18 changes: 18 additions & 0 deletions roles/oneview_ethernet_network/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,21 @@
- "{{ ethernet_network_bulk[4].uri }}"
delegate_to: localhost
when: currentVersion >= '1600'

- name: Create Ethernet Networks in bulk for automation
oneview_ethernet_network:
config: "{{ config }}"
state: present
data:
vlanIdRange: '1-3,5,7'
purpose: General
namePrefix: TestNetwork
smartLink: false
privateNetwork: false
bandwidth:
maximumBandwidth: 10000
typicalBandwidth: 2000
delegate_to: localhost
register: bulk_ethernet_create
- debug: msg='{{ethernet_network_bulk | map(attribute='name') | list }}'
- debug: msg='{{ ethernet_network_bulk }}'
1 change: 1 addition & 0 deletions roles/oneview_fc_network_facts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
config: "{{ config }}"
name: "{{ fc_networks[0]['name'] }}"
delegate_to: localhost
when: fc_networks == True

- debug: var=fc_networks
2 changes: 1 addition & 1 deletion roles/oneview_hypervisor_cluster_profile/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (2016-2020) Hewlett Packard Enterprise Development LP
Copyright (2016-2021) 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.
Expand Down
36 changes: 18 additions & 18 deletions roles/oneview_hypervisor_cluster_profile/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@
delegate_to: localhost
register: hyp_cp

# - name: Delete the Hypervisor Cluster Profile
# oneview_hypervisor_cluster_profile:
# config: "{{ config }}"
# state: absent
# params:
# force: True
# soft_delete: False
# data: "{{ hyp_cp.ansible_facts.hypervisor_cluster_profile }}"
# delegate_to: localhost
# register: deleted
#
- name: Delete the Hypervisor Cluster Profile
oneview_hypervisor_cluster_profile:
config: "{{ config }}"
state: absent
params:
force: True
soft_delete: False
data:
name: "HCP-renamed"
delegate_to: localhost

# - name: Delete the Hypervisor Cluster Profile with vswitch
# oneview_hypervisor_cluster_profile:
# config: "{{ config }}"
Expand All @@ -125,10 +125,10 @@
# delegate_to: localhost
# register: deleted
#
# - name: Do nothing when Hypervisor Cluster Profile is absent
# oneview_hypervisor_cluster_profile:
# config: "{{ config }}"
# state: absent
# data: "{{ hyp_cp.ansible_facts.hypervisor_cluster_profile }}"
# delegate_to: localhost
# register: deleted
- name: Do nothing when Hypervisor Cluster Profile is absent
oneview_hypervisor_cluster_profile:
config: "{{ config }}"
state: absent
data:
name: "HCP-renamed"
delegate_to: localhost
6 changes: 3 additions & 3 deletions roles/oneview_id_pools_ipv4_range/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# defaults file for oneview_id_pools_ipv4_ranges
config: "~/.ansible/collections/ansible_collections/hpe/oneview/roles/oneview_id_pools_ipv4_ranges/files/oneview_config.json"
subnet_name: Range Test IPv4 Subnet
config: "~/.ansible/collections/ansible_collections/hpe/oneview/roles/oneview_id_pools_ipv4_range/files/oneview_config.json"
subnet_name: IPv4Subnet
range_name: Experts Range
disabled_range_name: DISABLED - Experts Range
subnet_uri: "/rest/id-pools/ipv4/subnets/8e382eba-6731-4980-88de-ef1278eaf8d6"
subnet_uri: "/rest/id-pools/ipv4/subnets/1654c5cf-0e3d-4bc2-b5af-604a150e0fc0"
6 changes: 3 additions & 3 deletions roles/oneview_id_pools_ipv4_range/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
endAddress: 192.168.1.54
delegate_to: localhost

- set_fact: uri="{{ id_pool_ipv4_range['uri'] }}"
- set_fact: uri="{{ id_pools_ipv4_range['uri'] }}"

- name: Update the ID Pools IPV4 Range with end address 101
oneview_id_pools_ipv4_range:
Expand Down Expand Up @@ -41,7 +41,7 @@
config: "{{ config }}"
state: present
data:
uri: ""
uri: "{{ uri }}"
count: 2
update_allocator: True
idList:
Expand All @@ -53,7 +53,7 @@
config: "{{ config }}"
state: present
data:
uri: ""
uri: "{{ uri }}"
update_collector: True
idList:
- ""
Expand Down
2 changes: 1 addition & 1 deletion roles/oneview_id_pools_ipv4_range_facts/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# defaults file for oneview_id_pools_ipv4_ranges
config: "~/.ansible/collections/ansible_collections/hpe/oneview/roles/oneview_id_pools_ipv4_range_facts/files/oneview_config.json"
subnet_name: subnet
subnet_name: 10.1.0.0
range_name: 10.1.0.0 Range 1
Loading

0 comments on commit c0bc18a

Please sign in to comment.