IDRAC in DELL R610 with ipmi_power

138 views
Skip to first unread message

Kevin Kwon

unread,
May 17, 2019, 12:39:50 AM5/17/19
to Ansible Project

Hi.. 

I am trying to power management by "impi_power"

First, I had checked the "ipmitool" is working on Ansible-Controller like below.

root@ubuntu-Ansible:~#
root@ubuntu-Ansible:~# ipmitool -I lanplus -H 192.168.200.211 -U root -P password power status
Chassis Power is on
root@ubuntu-Ansible:~#



Here is my playbook.

root@ubuntu-Ansible:~# cat Host-Power_Off-01.yml
---
- name: Power Off to Host -  TEST
  hosts: DELL-R610
  tasks:
  - name: Power OFF Server
    ipmi_power:
      name: "192.168.200.211"
      user: "root"
      password: "password"
      timeout: 600
      state: "on"

when i ran it, it was failed like below.
would you please let me know what is wrong in my playbook?

root@ubuntu-Ansible:~# ansible-playbook Host-Power_Off-01.yml

PLAY [Power Off to Host -  TEST] *****************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************
fatal: [DELL-R610]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: root@dell-r610: Permission denied (password).", "unreachable": true}
        to retry, use: --limit @/root/Host-Power_Off-01.retry

PLAY RECAP ***************************************************************************************************************************************************
DELL-R610                  : ok=0    changed=0    unreachable=1    failed=0

root@ubuntu-Ansible:~#

Kevin

Kai Stian Olstad

unread,
May 17, 2019, 4:34:14 AM5/17/19
to ansible...@googlegroups.com
On 17.05.2019 06:39, Kevin Kwon wrote:
> I am trying to power management by "impi_power"
>
> First, I had checked the "ipmitool" is working on Ansible-Controller like
> below.
>
> root@ubuntu-Ansible:~#
> root@ubuntu-Ansible:~# ipmitool -I lanplus -H 192.168.200.211 -U root -P
> password power status
> Chassis Power is on
> root@ubuntu-Ansible:~#
>
>
>
> Here is my playbook.
>
> root@ubuntu-Ansible:~# cat Host-Power_Off-01.yml
> ---
> - name: Power Off to Host - TEST
> hosts: DELL-R610
> tasks:
> - name: Power OFF Server
> ipmi_power:
> name: "192.168.200.211"
> user: "root"
> password: "password"
> timeout: 600
> state: "on"
>
> when i ran it, it was failed like below.
> would you please let me know what is wrong in my playbook?

This playbook is logging in to the host DELL-R610 to run the Ansible module ipmi_power.
But I guess you would like to run the mdoule ipmi_power on the ansible controller aka localhost?

If so you need to delegate the task to localhost with "delegate_to: localhost" or setting the "connection: local" in the play.


> root@ubuntu-Ansible:~# ansible-playbook Host-Power_Off-01.yml
>
> PLAY [Power Off to Host - TEST]
> *****************************************************************************************************************************
>
> TASK [Gathering Facts]
> ***************************************************************************************************************************************
> fatal: [DELL-R610]: UNREACHABLE! => {"changed": false, "msg": "Failed to
> connect to the host via ssh: root@dell-r610: Permission denied
> (password).", "unreachable": true}
> to retry, use: --limit @/root/Host-Power_Off-01.retry
>

In this message you can see that Ansible is trying to login with root@dell-r610


--
Kai Stian Olstad

Kevin Kwon

unread,
May 17, 2019, 5:17:37 AM5/17/19
to Ansible Project

Hi.. Kai!

Thank you so much your help!
after change my playbook like below, it is working successfully.

Have a nice weekend!
Kevin


root@ubuntu-Ansible:~# cat Host-Power_Off-01.yml
---
- name: Power Off to Host -  TEST
  hosts: localhost
  tasks:
  - name: Power OFF Server
    ipmi_power:
      name: "192.168.200.211"   <=== Target DELL R610 Server's IPMI Address
      user: "root"
      password: "password"
      timeout: 600
      state: "off"


Reply all
Reply to author
Forward
0 new messages