Hi Kai Stian Olstad.

Thanks for the revert, when i tried expect module in play book i am seeing 
below error

root@ubuntu-16-04-4-server-amd64:/etc/ansible# ansible-playbook 
consoleservers.yml
ERROR! conflicting action statements: command, expect

The error appears to be in '/etc/ansible/consoleservers.yml': line 4, 
column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  tasks:
  - name: Reboot
    ^ here

if i comment expect in playbook then playbook runs well but still host is 
uneachable, please see below output

root@ubuntu-16-04-4-server-amd64:/etc/ansible# ansible-playbook 
consoleservers.y                                                            
                            ml

PLAY [all] 
*********************************************************************

TASK [Gathering Facts] 
*********************************************************
fatal: [10.219.14.74]: UNREACHABLE! => {"changed": false, "msg": "Failed to 
conn                                                                        
                ect to the host via ssh: Permission denied 
(publickey,keyboard-interactive).", "                                      
                                                  unreachable": true}

PLAY RECAP 
*********************************************************************
10.219.14.74               : ok=0    changed=0    unreachable=1    
failed=0    s                                                              
                          kipped=0    rescued=0    ignored=0

below is the playbook i am trying, the agenda of playbook is to reboot the 
console server. i have used expect module in two different places but no 
luck, could you please suggest.
i am very new to ansible.

 - hosts: all
  #expect:
  tasks:
  - name: Reboot
   # expect:
    command: reboot
    #responses:
     #(?i)password: "linux"
    #no_log: true




On Friday, October 18, 2019 at 2:05:24 AM UTC+5:30, Kai Stian Olstad wrote:
>
> On 17.10.2019 22:26, Shashidhar Reddy wrote: 
> > Hello , 
> > 
> > root@ubuntu-16-04-4-server-amd64:/# ansible --version 
> > ansible 2.8.5 
> >    config file = /etc/ansible/ansible.cfg 
> >    configured module search path = [u'/root/.ansible/plugins/modules', 
> > u'/usr/share/ansible/plugins/modules'] 
> >    ansible python module location = 
> /usr/lib/python2.7/dist-packages/ansible 
> >    executable location = /usr/bin/ansible 
> >    python version = 2.7.12 (default, Oct  8 2019, 14:14:10) [GCC 5.4.0 
> > 20160609] 
> > 
> > 
> > I wanted to manage Avocent Console servers using ansible play books but 
> i 
> > am not able to ping to Avocent  Console Server hosts from Ansible 
> > Controller, please see the error output mentioned below. 
>
> Ansible need a proper shell and Python on the remote node to work, I doubt 
> Avocent Console has that. 
>
> If it has a proper shell the raw module might work, if not your only 
> choice is the expect module. 
>
>
> -- 
> Kai Stian Olstad 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dc78ef19-d95c-4b3e-aa03-b1b3f2684e3c%40googlegroups.com.

Reply via email to