dell / redfish-ansible-module

Ansible modules for Out-Of-Band Controllers using Redfish APIs
GNU General Public License v3.0
195 stars 80 forks source link

playbook power.yml doesn't work #22

Closed jherreraBE closed 6 years ago

jherreraBE commented 6 years ago

hi,

I tried the the power.yml playbook, but it doesn't work .. Ansible says everything is ok but the server doesn't want to start : `7514756@s51lv1c:~/Ansible/drp-sn/ansible $ ansible-playbook -i pipo -u 7514756 power_dell_mdc.yml -vvv Using /home/7514756/Ansible/drp-sn/ansible/ansible.cfg as config file

PLAYBOOK: power_dell_mdc.yml ** 1 plays in power_dell_mdc.yml

PLAY [PowerEdge iDRAC Manage System Power] **** META: ran handlers

TASK [Turn system power on] *** task path: /home/7514756/Ansible/drp-sn/ansible/power_dell_mdc.yml:23 Using module file /home/7514756/Ansible/drp-sn/ansible/module/idrac-ansible-module-master/library/idrac.py

ESTABLISH LOCAL CONNECTION FOR USER: 7514756 EXEC /bin/sh -c 'echo ~ && sleep 0' EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/7514756/.ansible/tmp/ansible-tmp-1506934891.87-50325564528704 `" && echo ansible-tmp-1506934891.87-50325564528704="` echo /home/7514756/.ansible/tmp/ansible-tmp-1506934891.87-50325564528704 `" ) && sleep 0' PUT /tmp/tmpiGwr8d TO /home/7514756/.ansible/tmp/ansible-tmp-1506934891.87-50325564528704/idrac.py EXEC /bin/sh -c 'chmod u+x /home/7514756/.ansible/tmp/ansible-tmp-1506934891.87-50325564528704/ /home/7514756/.ansible/tmp/ansible-tmp-1506934891.87-50325564528704/idrac.py && sleep 0' EXEC /bin/sh -c '/usr/bin/python2 /home/7514756/.ansible/tmp/ansible-tmp-1506934891.87-50325564528704/idrac.py; rm -rf "/home/7514756/.ansible/tmp/ansible-tmp-1506934891.87-50325564528704/" > /dev/null 2>&1 && sleep 0' ok: [s51l007.cmctst.be -> localhost] => { "changed": false, "invocation": { "module_args": { "category": "SystemPower", "command": "PowerOn", "hostname": null, "idracip": "1.2.3.4", "idracpswd": "xxxx", "idracuser": "root", "sharehost": null, "sharename": null, "sharepswd": null, "shareuser": null, "userid": "16", "username": null, "userpswd": null, "userrole": null } }, "result": 405 } META: ran handlers META: ran handlers PLAY RECAP ************************************************************************************************************************ s51l007.cmctst.be : ok=1 changed=0 unreachable=0 failed=0 ` the only strange thing I see is that the userid is 16 and in my webconsole root has userid 2.... kind regards, Jonay
jose-delarosa commented 6 years ago

Thank you for reporting. Adding code today to catch errors, which many functions did not have. Should have everything committed today 10.02, at least for power playbook.

jose-delarosa commented 6 years ago

Try again with latest commit

jherreraBE commented 6 years ago

Hi Jose,

I have tested and works ! :-) but I have now another problem. when I launch the playbook with the option "--check" it execute the module --> dangerous !!

7514756@s51lv1c:~/Ansible/drp-sn/ansible $ ansible-playbook -i pipo -u 7514756 power_dell_mdc.yml **--check**  -vvv 
Using /home/7514756/Ansible/drp-sn/ansible/ansible.cfg as config file

PLAYBOOK: power_dell_mdc.yml *****************************************************************************************************************************************************************
1 plays in power_dell_mdc.yml

PLAY [PowerEdge iDRAC Manage System Power] ***************************************************************************************************************************************************
META: ran handlers

TASK [Turn system power on] ******************************************************************************************************************************************************************
task path: /home/7514756/Ansible/drp-sn/ansible/power_dell_mdc.yml:23
Using module file /home/7514756/Ansible/drp-sn/ansible/module/idrac/library/idrac.py
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: 7514756
<localhost> EXEC /bin/sh -c 'echo ~ && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/7514756/.ansible/tmp/ansible-tmp-1507035172.84-139294187111285 `" && echo ansible-tmp-1507035172.84-139294187111285="` echo /home/7514756/.ansible/tmp/ansible-tmp-1507035172.84-139294187111285 `" ) && sleep 0'
<localhost> PUT /tmp/tmp_LH6EG TO /home/7514756/.ansible/tmp/ansible-tmp-1507035172.84-139294187111285/idrac.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/7514756/.ansible/tmp/ansible-tmp-1507035172.84-139294187111285/ /home/7514756/.ansible/tmp/ansible-tmp-1507035172.84-139294187111285/idrac.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /home/7514756/.ansible/tmp/ansible-tmp-1507035172.84-139294187111285/idrac.py; rm -rf "/home/7514756/.ansible/tmp/ansible-tmp-1507035172.84-139294187111285/" > /dev/null 2>&1 && sleep 0'
ok: [rc-s51l007.cmc.be -> localhost] => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "bootdevice": null, 
            "category": "SystemPower", 
            "command": "PowerOn", 
            "hostname": null, 
            "idracip": "10.151.88.25", 
            "idracpswd": "calvin", 
            "idracuser": "root", 
            "sharehost": null, 
            "sharename": null, 
            "sharepswd": null, 
            "shareuser": null, 
            "userid": null, 
            "username": null, 
            "userpswd": null, 
            "userrole": null
        }
    }, 
    "result": {}
}
META: ran handlers
META: ran handlers

PLAY RECAP ***********************************************************************************************************************************************************************************
rc-s51l007.cmc.be          : ok=1    changed=0    unreachable=0    failed=0   

7514756@s51lv1c:~/Ansible/drp-sn/ansible $ 
jose-delarosa commented 6 years ago

Thank you. Module does not currently support check mode so I will add code for it. For documentation purposes, I will close this issue and open a new one.

jherreraBE commented 6 years ago

H Jose, OK ! thanks, How can I know when the code is updated ? thanks for the quick responses !!! ;-)

kind regards,

Jonay

jose-delarosa commented 6 years ago

Jonay,

I turned off support for check mode, which has effect of not running tasks when passing --check mode. I tested it with some playbooks, but let me know otherwise.