I've written the following playbook that seems to work perfectly, except 
when I comment out the kernel update task. Hopefully nothing that I've just 
missed from the docs.

---
- 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



The other updates work fine so I'm not sure what could be causing the issue.
Also, is there a way to embed the encrypted password for the ansible 
account somewhere secret somewhere rather than having to enter the sudo 
password all the time? Not sure what is best practice with Ansible?

Thanks in advance.

-- 
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/8410ae09-8af1-409c-a444-2cfd5cf635a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to