dell / dellemc-openmanage-ansible-modules

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

Fatal error while using `idrac_os_deployment` module #396

Closed rht-rkaruppu closed 1 year ago

rht-rkaruppu commented 2 years ago
Question

Issue while deploying OS using idrac_os_deployment module

Details

playbook:

[rkaruppu@builder-dagoba-dfw3 play]$ ansible-playbook -i ../inventory/inventory-devaron-ipmi-ceph.yaml idrac_os_deployment.yml -vvv

cat idrac_os_deployment.yml

 name: os deployment
  hosts: all
  gather_facts: false
  collections:
    - dellemc.openmanage

  tasks:
  - name: "Booting to Network Operating System image"
    idrac_os_deployment:
      idrac_ip: "{{ ansible_host }}"
      idrac_user: "{{ ansible_user }}"
      idrc_password: "{{ ansible_password }}"
      share_name: "10.222.0.7:/ISOS/"
      iso_image:  "rhel-8.2-kickstart.iso"
      expose_duration: 180

Inventory file:

[rkaruppu@builder-dagoba-dfw3 play]$ cat ../inventory/inventory-devaron-ipmi-ceph.yaml

all:
  children:
    cephwaldorf:
      vars:
        ansible_python_interpreter: /usr/bin/python3
     #hostname: 'ceph00-waldorf-dfw3.ole.redhat.com'
      hosts:
        ceph02-waldorf-dfw3:
          ansible_host: '10.222.8.47'
          #canonical_hostname: ceph02-waldorf-dfw3.ole.redhat.com
          ansible_user: 'root'
          ansible_password: *******

Error details:

ASK [Booting to Network Operating System image] ****************************************************************************************************************************
task path: /content/Novello_Admins/rkaruppu/Ansible/play/idrac_os_deployment.yml:8                                                                                           
<10.222.8.47> ESTABLISH SSH CONNECTION FOR USER: root                                                                                                                        
<10.222.8.47> SSH: EXEC sshpass -d9 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/home/rkaruppu/.ansible/cp/43806a
f525 10.222.8.47 '/bin/sh -c '"'"'echo ~root && sleep 0'"'"''                                                                                                                
<10.222.8.47> (0, b'ERROR: Invalid command specified.\n', b'')                                                                                                               
<10.222.8.47> ESTABLISH SSH CONNECTION FOR USER: root                                                                                                                        
<10.222.8.47> SSH: EXEC sshpass -d9 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/home/rkaruppu/.ansible/cp/43806a
f525 10.222.8.47 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo ERROR: Invalid command specified./.ansible/tmp `"&& mkdir "` echo ERROR: Invalid command specified./.ansible
/tmp/ansible-tmp-1649229129.218698-905204-277044378794847 `" && echo ansible-tmp-1649229129.218698-905204-277044378794847="` echo ERROR: Invalid command specified./.ansible/
tmp/ansible-tmp-1649229129.218698-905204-277044378794847 `" ) && sleep 0'"'"''                                                                                               
<10.222.8.47> (0, b'ERROR: Invalid command specified.\n', b'')                                                                                                               
Using module file /home/rkaruppu/.ansible/collections/ansible_collections/dellemc/openmanage/plugins/modules/idrac_os_deployment.py                                          
<10.222.8.47> PUT /home/rkaruppu/.ansible/tmp/ansible-local-905197fagfpmsk/tmpbonex7jj TO ERROR: Invalid command specified./AnsiballZ_idrac_os_deployment.py                 
<10.222.8.47> SSH: EXEC sshpass -d9 scp -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/home/rkaruppu/.ansible/cp/43806a
f525 /home/rkaruppu/.ansible/tmp/ansible-local-905197fagfpmsk/tmpbonex7jj '[10.222.8.47]:'"'"'ERROR: Invalid command specified./AnsiballZ_idrac_os_deployment.py'"'"''       
fatal: [ceph02-waldorf-dfw3]: FAILED! => {                                                                                                                                   
    "msg": "failed to transfer file to /home/rkaruppu/.ansible/tmp/ansible-local-905197fagfpmsk/tmpbonex7jj ERROR: Invalid command specified./AnsiballZ_idrac_os_deployment.py:\n\nERROR: Invalid command specified.\n"                                                                                                                                  
}             
sshnaidm commented 2 years ago

Make sure 10.222.8.47 is not IDRAC, but usual linux machine. You can't run ansible on IDRAC itself.

jagadeeshnv commented 1 year ago

@rht-rkaruppu Could not reproduce this issue - We may need more details like - iDRAC firmware version and also the collection version.

Also as @sshnaidm suggested - make sure the iDRAC IP is passed and not the ansible host IP. Our modules do not SSH into iDRAC, so add a connection: local or delegateto: localhost in the playbook.

jagadeeshnv commented 1 year ago

@rht-rkaruppu Looks like #399 is also duplicate of this - Kindly request you to close one of them.

sachin-apa commented 1 year ago

Please use the role idrac_os-deployment instead, we have added this to use virtual media instead of SCP.