reboot with ignore_errors still errors out

161 views
Skip to first unread message

pixel fairy

unread,
Feb 18, 2017, 10:56:37 PM2/18/17
to Ansible Project
trying to reboot with ignore_errors: true still errors out.  control machine and all ceph nodes run ubuntu 16.04. ansible 2.2.1.0 installed with pip

---

- hosts: osds
  serial
: 1

  tasks
:

 
- name: Set the noout flag
    command
: ceph osd set noout


 
- name: Reboot the server
    command
: shutdown -r now "Ansible updates triggered"
    async
: 0
    poll
: 0
    ignore_errors
: true


 
- name: Wait for the server to come up
    local_action
: wait_for host={{ ansible_host }} state=started delay=10 timeout=3600
    become
: false


 
- name: Unset the noout flag
    command
: ceph osd unset noout


when running,

< PLAY [osds] >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


 ______________
< TASK [setup] >
 --------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


ok: [ceph1]
 ___________________________
< TASK [Set the noout flag] >
 ---------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


changed: [ceph1]
 __________________________
< TASK [Reboot the server] >
 --------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


fatal: [ceph1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Shared connection to 10.1.10.31 closed.\r\n", "unreachable": true}
 to retry, use: --limit @/home/user/victims/wdc/ansible/cluster/ceph-rollingboot.retry
 ____________
< PLAY RECAP >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


ceph1                      : ok=2    changed=1    unreachable=1    failed=0  




Pshem Kowalczyk

unread,
Feb 19, 2017, 2:30:59 AM2/19/17
to Ansible Project
Hi,

Perhaps not directly answering your question - but a workaround I used in a number of playbooks (added to the tasks that times out, in your case the one that unsets the noout):

- name: Unset the noout flag
command: ceph osd unset noout
register: result
  until: result.failed is undefined
  retries: 10
  delay: 10

to overcome the issues with premature failure due to timeouts.

you might also find 
- pause: seconds=60

useful if you know it takes some time for the machine to come back.

kind regards
Pshem




--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bf7dde53-f0e1-4ad9-a273-16e91dd4fc75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Coca

unread,
Feb 20, 2017, 9:45:46 AM2/20/17
to Ansible Project
ignore error will not avoid connection errors, only task errors, so
'UNREACHABLE' will not be captured by it.
> https://groups.google.com/d/msgid/ansible-project/CAEaZiRU-5_RfETg5BinS5hSkikgVaAvvjK_yBE%2BNy5Wi1tLouQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages