>
> From the command module documentation:
> "It will not be processed through the shell, so variables like $HOME and
> operations like "<", ">", "|", and "&" will not work (use the shell module
> if you need these features)."
>
Thanks, I missed that one. I have this now:
- name: reboot system if required
shell: removes=/var/run/reboot-required sleep 2 && shutdown -r now
'Rebooting to complete system upgrade'
async: 1
poll: 0
ignore_errors: true
register: reboot
- name: wait for server to come back
local_action: wait_for host={{ inventory_hostname }} state=started
delay=2 timeout=300
when: reboot.unreachable is defined and reboot.unreachable
Still not working though. It successfully execute the reboot, but the wait
task is skipped and then I get an unreachable error on the following tasks.
Any idea on how to know when a reboot was executed? :(
Regards,
Francisco
On Fri, May 27, 2016 at 1:48 PM, Kai Stian Olstad <
[email protected]> wrote:
> On 27. May 2016 17:10, Francisco Lopes wrote:
>
>> - name: reboot system if required
>>
> > command: removes=/var/run/reboot-required sleep 1 && shutdown -r now
> 'Rebooting to complete system upgrade'
>
> From the command module documentation:
> "It will not be processed through the shell, so variables like $HOME and
> operations like "<", ">", "|", and "&" will not work (use the shell module
> if you need these features)."
>
> --
> 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 [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/cc37cbd9-40ef-ba02-49aa-1c19af681550%40olstad.com
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CAKK1Gd%2B32GuvUymXQjh5rOkeH4G7NuNQvF6uhXUmNJzikkZi1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.