Hi I'm getting below error during sw upgrade of a server using Ansible. 
Remote machine is BSD unix server. Note that the reboot is not initiated by 
Ansible. At the end of the sw upgrade the server reboot automatically 
(application initiated reboot). Can anybody help?

fatal: [192.168.1.131]: UNREACHABLE! => {"changed": false, "msg": "Failed 
to connect to the host via ssh: Shared connection to 192.168.1.131 
closed.\r\n", "unreachable": true}


Script.

- hosts: remote_server 
  remote_user: ansible
  become: yes
  become_method: sudo
  connection: ssh
  gather_facts: yes
  vars:
     ansible_ssh_host: 192.168.1.131
     ansible_ssh_port: 22 
  tasks:
  - name: Install SW version xxx
    ....
    ....

  - name: waiting for server to reboot
    wait_for: host="{{ ansible_ssh_host | default(inventory_hostname) }}" 
port={{ ansible_ssh_port | default(22) }} search_regex=OpenSSH delay=60 
timeout=300 
    connection: local
    sudo: false  

  - shell: uptime
    register: output
  - debug: msg=" {{ output.stdout }} "

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/334dc5a0-17fa-404e-b752-b604b96dd9fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to