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
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
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