From b9fccd389db95346c4adc6713dc6b89e38526e22 Mon Sep 17 00:00:00 2001 From: spapinwar Date: Fri, 15 Jul 2022 20:40:54 +0530 Subject: [PATCH 1/4] resolved few issues based on automation report --- .../tasks/main.yml | 2 +- roles/oneview_enclosure_facts/tasks/main.yml | 6 +++--- roles/oneview_server_hardware/tasks/main.yml | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/roles/oneview_appliance_device_snmp_v3_trap_destination_facts/tasks/main.yml b/roles/oneview_appliance_device_snmp_v3_trap_destination_facts/tasks/main.yml index 07880022..aa09585e 100644 --- a/roles/oneview_appliance_device_snmp_v3_trap_destination_facts/tasks/main.yml +++ b/roles/oneview_appliance_device_snmp_v3_trap_destination_facts/tasks/main.yml @@ -47,7 +47,7 @@ sessionID: "{{ session.ansible_facts.session }}" uri: "{{ appliance_device_snmp_v3_trap_destinations['uri'] }}" delegate_to: localhost - when: appliance_device_snmp_v3_trap_destinations is True + when: appliance_device_snmp_v3_trap_destinations is defined - debug: var: appliance_device_snmp_v3_trap_destinations diff --git a/roles/oneview_enclosure_facts/tasks/main.yml b/roles/oneview_enclosure_facts/tasks/main.yml index 24037382..e4bc5239 100644 --- a/roles/oneview_enclosure_facts/tasks/main.yml +++ b/roles/oneview_enclosure_facts/tasks/main.yml @@ -50,7 +50,7 @@ oneview_enclosure_facts: config: "{{ config }}" sessionID: "{{ session.ansible_facts.session }}" - name: "{{ contents.enclosure.name }}" + name: "{{ contents.enclosure.enclosure_name }}" delegate_to: localhost - debug: var=enclosures @@ -60,7 +60,7 @@ oneview_enclosure_facts: config: "{{ config }}" sessionID: "{{ session.ansible_facts.session }}" - name: "{{ contents.enclosure.name }}" + name: "{{ contents.enclosure.enclosure_name }}" options: - script when: contents.variant == 'C7000' or currentVersion == '300' @@ -69,7 +69,7 @@ - name: Gather facts about an Enclosure by name with options oneview_enclosure_facts: config: "{{ config }}" - name: "{{ contents.enclosure.name }}" + name: "{{ contents.enclosure.enclosure_name }}" sessionID: "{{ session.ansible_facts.session }}" options: - environmentalConfiguration # optional diff --git a/roles/oneview_server_hardware/tasks/main.yml b/roles/oneview_server_hardware/tasks/main.yml index 967e4d92..9a2e12f9 100644 --- a/roles/oneview_server_hardware/tasks/main.yml +++ b/roles/oneview_server_hardware/tasks/main.yml @@ -29,7 +29,7 @@ initialScopeUris: - "{{ scopes[0]['uri'] }}" #Supported only with OneView API version >= 600. delegate_to: localhost - when: variant == 'C7000' + when: contents.server_hardware.variant == 'C7000' - name: Do nothing when the server hardware is already present oneview_server_hardware: @@ -44,7 +44,7 @@ licensingIntent: "OneView" configurationState: "Managed" delegate_to: localhost - when: variant == 'C7000' + when: contents.server_hardware.variant == 'C7000' #This task available only with OneView API version >= 600. - name: Add multiple rack-mount servers @@ -61,7 +61,7 @@ licensingIntent: "OneView" configurationState: "Managed" delegate_to: localhost - when: variant == 'C7000' + when: contents.server_hardware.variant == 'C7000' - name: Gather facts about all Server Hardwares oneview_server_hardware_facts: @@ -189,7 +189,7 @@ data: name: "{{ contents.server_hardware.server_hardware_hostname }}" delegate_to: localhost - when: variant == 'C7000' + when: contents.server_hardware.variant == 'C7000' - name: Do nothing when the server hardware is already removed oneview_server_hardware: @@ -199,4 +199,4 @@ data: name: "{{ contents.server_hardware.server_hardware_hostname }}" delegate_to: localhost - when: variant == 'C7000' + when: contents.server_hardware.variant == 'C7000' From 39bf52c494a91faea7a5ea00909c0133051d2534 Mon Sep 17 00:00:00 2001 From: spapinwar Date: Fri, 15 Jul 2022 22:51:17 +0530 Subject: [PATCH 2/4] resolved few issues based on automation report --- roles/oneview_server_hardware/defaults/main.yml | 2 +- roles/oneview_user/tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/oneview_server_hardware/defaults/main.yml b/roles/oneview_server_hardware/defaults/main.yml index 609369df..c5e1190f 100644 --- a/roles/oneview_server_hardware/defaults/main.yml +++ b/roles/oneview_server_hardware/defaults/main.yml @@ -1,4 +1,4 @@ --- # defaults file for oneview_server_hardware config: "~/.ansible/collections/ansible_collections/hpe/oneview/roles/oneview_server_hardware/files/oneview_config.json" -contents: "{{lookup('file', config)}}" \ No newline at end of file +contents: "{{lookup('file', '../config/config.json') | from_json}}" \ No newline at end of file diff --git a/roles/oneview_user/tasks/main.yml b/roles/oneview_user/tasks/main.yml index a5b750d2..b7dc1c6f 100644 --- a/roles/oneview_user/tasks/main.yml +++ b/roles/oneview_user/tasks/main.yml @@ -84,7 +84,7 @@ data: userName: "{{ contents.users.user_name }}" oldPassword: "myPass1234" - newPassword: "{{ contents.users.newPassword }}" + newPassword: "{{ contents.users.newpassword }}" delegate_to: localhost - name: Adds multiple new local users to the appliance From 6faff099385188e86d105cfb54decedfcd5c5e49 Mon Sep 17 00:00:00 2001 From: spapinwar Date: Sat, 16 Jul 2022 00:53:49 +0530 Subject: [PATCH 3/4] resolved few issues based on automation report --- roles/oneview_enclosure_facts/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/oneview_enclosure_facts/tasks/main.yml b/roles/oneview_enclosure_facts/tasks/main.yml index e4bc5239..a8676d7d 100644 --- a/roles/oneview_enclosure_facts/tasks/main.yml +++ b/roles/oneview_enclosure_facts/tasks/main.yml @@ -63,7 +63,7 @@ name: "{{ contents.enclosure.enclosure_name }}" options: - script - when: contents.variant == 'C7000' or currentVersion == '300' + when: contents.enclosure.variant == 'C7000' or currentVersion == '300' delegate_to: localhost - name: Gather facts about an Enclosure by name with options From dd63b3a349503a0ee6ea10f8ae144fe003c4b652 Mon Sep 17 00:00:00 2001 From: spapinwar Date: Sat, 16 Jul 2022 01:04:10 +0530 Subject: [PATCH 4/4] resolved few issues based on automation report --- roles/oneview_user/tasks/main.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/roles/oneview_user/tasks/main.yml b/roles/oneview_user/tasks/main.yml index b7dc1c6f..e030de62 100644 --- a/roles/oneview_user/tasks/main.yml +++ b/roles/oneview_user/tasks/main.yml @@ -76,17 +76,6 @@ newPassword: "{{ contents.users.newpassword }}" delegate_to: localhost -- name: Change the User's password during first-time setup - oneview_user: - config: "{{ config }}" - sessionID: "{{ session.ansible_facts.session }}" - state: set_password - data: - userName: "{{ contents.users.user_name }}" - oldPassword: "myPass1234" - newPassword: "{{ contents.users.newpassword }}" - delegate_to: localhost - - name: Adds multiple new local users to the appliance oneview_user: config: "{{ config }}"