dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
339 stars 163 forks source link

dellemc_get_system_inventory trailing ' ,' module args IP and user #155

Closed Diddely closed 4 years ago

Diddely commented 4 years ago

https://github.com/dell/dellemc-openmanage-ansible-modules/blob/devel/guides/OMAM_2.1.1_Users_Guide.pdf.. Running your first iDRAC Playbook : _inventory:[PowerEdge]R740.example.com, idrac_ip='192.168.10.10', idrac_user='root', idrac_password='idracpassword'

Running with this causes trailing ,'s to be added the module args, IP and User, but not the FQDN..

<loci-h13.infra.lab.local,> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1600249551.0605316-56544-103198700649040/ > /dev/null 2>&1 && sleep 0' The full traceback is: File "/tmp/ansible_dellemc_get_system_inventory_payload_sl92nhzr/ansible_dellemc_get_system_inventory_payload.zip/ansible/modules/remote_management/dellemc/dellemc_get_system_inventory.py", line 103, in main File "/tmp/ansible_dellemc_get_system_inventory_payload_sl92nhzr/ansible_dellemc_get_system_inventory_payload.zip/ansible/module_utils/remote_management/dellemc/dellemc_idrac.py", line 50, in enter raise RuntimeError(msg) [WARNING]: The value 443 (type int) in a string field was converted to '443' (type string). If this does not look like what you expect, quote the entire value to ensure it does not change. fatal: [loci-h13.infra.lab.local,]: FAILED! => { "changed": false, "invocation": { "module_args": { "idrac_ip": "10.226.245.95,", "idrac_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "idrac_port": "443", "idrac_user": "root," } }, "msg": "Could not find device driver for iDRAC with IP Address: 10.226.245.95,"

This passes when _inventory:[PowerEdge]R740.example.com, idrac_ip='192.168.10.10' idrac_user='root' idrac_password='idracpassword'

anupamaloke commented 4 years ago

@Diddely, most probably it might be an issue with iDRAC user credentials. Could you please verify that you are passing in the correct iDRAC User name and password?

Diddely commented 4 years ago

creds are correct, they are default..

if my inventory file looks like it does in the example Running your first iDRAC Playbook : inventory:[PowerEdge]R740.example.com, idrac_ip='192.168.10.10', idrac_user='root', idrac_password='idrac_password' the comma separating items was included, for ip and user.. I changed my inventory file look more like another host file example i saw with variables and it passed.

[all] fqdn, ip

[all:vars] idrac_user=root idrac_password=calvin]

i,ve not tested with 2.1.2.. Cheers

anupamaloke commented 4 years ago

@Diddely, it seems that the issue was with credentials The sample inventory is just an example. You can choose to setup your inventory file anyway you want. It just conveys that you must have the idrac_ip, idrac_user and idrac_password attributes defined as they are used by the OpenManage Ansible modules to read the iDRAC IP address and user credentials. You can define them in either your inventory file or as playbook variables or as group or host variables. You were getting the earlier error because the sample inventory file has idrac_password as the value of idrac_password attribute which is not the right password. In your second inventory file ,you are setting idrac_password to calvin which might be the correct password.

anupamaloke commented 4 years ago

@Diddely, I will be closing this issue. Please reopen if you are still facing this issue.

Diddely commented 4 years ago

Thanks... but just to be clear i had set user/password correctly.. inventory:[PowerEdge]R740.example.com, idrac_ip='192.168.10.10', idrac_user='root', idrac_password='calvin'

I was following the example in accompanying docs, as I'm relatively new to ansible and this resulted in the error, when i updated my inventory with variables shown above it passed. I was a pointing it out that either the doc is incorrect or needs to updated. Cheers