---
- name: system updates
hosts: production
remote_user: ansible
sudo: yes
tasks:
- name: install kernel updates
action: yum name=kernel* state=latest
# If there are any updates, we register the below
# This will trigger a reboot
register: kernelup
- name: install other updates
action: yum name=* state=latest
register: kernelup
- name: reboot the system
command: reboot
when: kernelup.changed
- name: wait for ssh to come back up
local_action: wait_for host={{ ansible_fqdn }} port=22 delay=120 timeout=900 state=started
when: kernelup.changed
- name: restart services
service: name=sendmail state=restarted
--
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/8410ae09-8af1-409c-a444-2cfd5cf635a1%40googlegroups.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 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/8410ae09-8af1-409c-a444-2cfd5cf635a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It seems that you should register 'kernelup' only for the first task, not twice.
--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/ygoE8zpQMlg/unsubscribe.
To unsubscribe from this group and all its topics, 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/539F1227.70609%40yahoo.gr.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADnEW0%3DwbvOb4s3BAiikbHLqVsWee6HQ5ikoaUgC%2BDYwK6UdZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
-- toscom - the open source company Christian Rusa Breiteneckergasse 32 1230 Wien Mobil: 0699 10205595 Fax: 01 9249633 www.toscom.at christi...@toscom.at
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/539F13BE.8000406%40toscom.at.
---
- name: system updates
hosts: production
remote_user: ansible
sudo: yes
tasks:
- name: install kernel updates
action: yum name=kernel* state=latest
# If there are any updates, we register the below
# This will trigger a reboot
register: kernelup
- name: install other updates
action: yum name=* state=latest
- name: reboot the system
command: reboot
when: kernelup.changed
- name: wait for ssh to come back up
local_action: wait_for host={{ ansible_fqdn }} port=22 delay=120 timeout=900 state=started
when: kernelup.changed
- name: restart services
service: name=sendmail state=restarted
--
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/5d862cee-6317-435e-a713-ac41830e4652%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/ygoE8zpQMlg/unsubscribe.
To unsubscribe from this group and all its topics, 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/CA%2BnsWgwXsG7rD7YRwE0hozpSDTmp0Y_kxw7hOBSR0c4rE-VSww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADnEW0k5DeCCv-DD_Nqa4gmXtWMEG_pUOPpR0dpV_rMXu0Ot%3Dw%40mail.gmail.com.