Hello all,
My playbook process is:
disable selinux
do core tasks
enable selinux
reboot
Reboot operation is the last task. When I execute my playbook, the reboot task is pending, just like this:
My task:
- name: reboot
command: /sbin/reboot -f
the task result is pending:
TASK: [reboot] ****************************************************************
How to avoid playbook pending in my case? Thank you.
BR
Rella
I use the wait_for module to handle reboots. http://www.ansibleworks.com/docs/modules.html#wait-for
Mine continues after a reboot so it may not fit your needs exactly.
My question is reboot task is pending. If I add wait_for task, my playbook is still pending in reboot task.
It seems reboot task is not completed. wait_for task doesn’t run.
My playbook:
The result is:
TASK: [reboot] ****************************************************************
_volanja
(@volanja)
December 27, 2013, 12:05am
4
Hi Rella.
Please test this code.
Reboot is background process.
So, not pending.
- name: reboot
shell: sleep 2s && /sbin/reboot &
_volanja
(@volanja)
December 29, 2013, 2:16pm
5
Hi Rella.
Please refer to it.
It is old thread that talking about reboot.
https://groups.google.com/forum/#!msg/ansible-project/9KVUY8yBKww/FHnX6FUvrH8J
And I wrote sample-code about reboot, But it’s japanese…
http://qiita.com/volanja/items/d38fe0678848bae6902f#2-6
volanja
2013年12月27日金曜日 9時05分58秒 UTC+9 @volanja :