Closed peterdolinski closed 3 years ago
Hi @peterdolinski ,
We have provided an example task to add multiple DL servers using list of iLO ips in oneview_server_hardware
role. (https://github.com/HewlettPackard/oneview-ansible-collection/blob/master/roles/oneview_server_hardware/tasks/main.yml#L38-L50)
For this to work you need to provide necessary info in below file. https://github.com/HewlettPackard/oneview-ansible-collection/blob/master/roles/oneview_server_hardware/defaults/main.yml#L6-L9
server_hardware_username: "user1"
server_hardware_password: "paswd"
multiple_hosts:
- "1.2.3.4"
- "1.2.3.5"
- "1.2.3.6"
Hi @peterdolinski , Please let us know if the solution is working for you. We will be closing the issue. You can re open if it is not working
Hello nabhajit-ray and Venkatesh Ravula,
I was on vacation and didn't respond on time, for which I am sorry.
No, for some reason it doesn't work. I copied and renamed the role so that I don't change the original one.
config: "~/.ansible/collections/ansible_collections/hpe/oneview/roles/ov_multiple_servers_hardware/files/oneview_config.json" contents: "{{lookup('file', config)}}" server_hardware_username: "admin" server_hardware_password: "password" multiple_hosts:
connection to oneview appliance oneview_config.json
"ip": "1.2.3.4", "credentials": { "userName": "Administrator", "authLoginDomain": "", "password": "local_password" }, "api_version": 2800 }
***Output [WARNING]: running playbook inside collection hpe.oneview
PLAY [all] **
TASK [Gathering Facts] ** ok: [localhost]
TASK [ov_multiple_servers_hardware : Add multiple rack-mount servers] ***
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 9 column 3 (char 191)
fatal: [localhost -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1628032039.0732534-259626770534831/AnsiballZ_oneview_server_hardware.py\", line 102, in
PLAY RECAP ** localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
I appreciate your feedback!!
Thank you,
Peter
From: nabhajit-ray @.> Sent: Monday, July 26, 2021 10:06 PM To: HewlettPackard/oneview-ansible-collection @.> Cc: Peter S. Dolinski @.>; Mention @.> Subject: Re: [HewlettPackard/oneview-ansible-collection] Adding Multiple Rack-mounted Servers (#129)
Hi @peterdolinskihttps://github.com/peterdolinski , Please let us know if the solution is working for you.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/HewlettPackard/oneview-ansible-collection/issues/129#issuecomment-887212315, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANZDGCJ2A5T72PFS5IKEU6LTZY5GPANCNFSM5AY4AWAA.
Hi @peterdolinski, After looking into your oneview_config.json in above comment, we can see that opening bracket in first line is missing that's because an error was thrown saying json structure is invalid in config file. Please refer https://github.com/HewlettPackard/oneview-ansible-collection/blob/master/roles/oneview_server_hardware/files/oneview_config.json and pass credentials accordingly. And also feel free to revert back if you see any issues even after giving proper json credentials structure. Thanks.
Hello everybody! I think the usage of the multiple iLo Ips against the creation of the hardware profile is working now. I was wondering, though how, and where I could incorporate a prompt to query the facts of just one hardware or server profile. Another use case is to point the playbook to a file with multiple server or hardware profiles to get facts or create profiles.
Also, how would you use the scopes to query the facts of the servers in a particular scope? I manually created a scope in the GUI and added 10 servers in it. So, now I would like to run a play to get facts out of them, for example, the WWPNs of the HBAs.
Thank you so much! I appreciate your knowledge!
I am trying to create server hardware for multiple servers using the "add multiple rack-mounted servers" tasks in "oneview_server_hardware" role. I am not sure how and where to specify the multiple iLo IPs or a range of IPs so that the playbook can create multiple hardware server instances in OneView at one time? . I have to work with iLo IPs because my servers are DLs, not blades. I see that the mpHostsAndRanges takes the multiple_hosts veritable from the /defaults/main.yml file.
Any suggestions will be appreciated!
Thanks, Peter