2.7.5
I'll look at the links you sent.
Thanks

On Wednesday, 15 May 2019 12:30:06 UTC+1, Tariq Hasan wrote:
>
> Hi
>
> Please find below my playbook
>
>  - name: Patch the server and Reboot
>     hosts: tariq-test
>     tasks:
>       - name: Patch the server
>         become: yes
>         become_user: root
>         tags: Patch
>         shell: "yum -y update"
>         exclude: kernel*,mongo*
>         register: patchresult
>
>       - name: Reboot the server
>         tags: reboot
>         become: yes
>         become_user: root
>         shell: "sleep 5 && reboot"
>         async: 1
>         poll: 0
>
>       - name: Wait for the reboot and reconnect
>         wait_for:
>           port: 22
>           host: '{{ 
> (ansible_ssh_host|default(ansible_host))|default(inventory_hostname) }}'
>           search_regex: OpenSSH
>           delay: 10
>           timeout: 60
>         connection: local
>
>       - name: Check the Uptime of the servers
>         shell: "uptime"
>         register: Uptime
>
>       - debug: var=Uptime
>
> I would like to able to run this via cron, but whenever I try, the job 
> starts, according to the cron log, but doesn't actually do anything.
> I've tried allsorts, nothing works.
>
> 07 11 * * * /bin/ansible-playbook /etc/ansible/playbooks/reboot.yml >> 
> /var/tmp/reboot.log  >/dev/null 2>&1
> 06 12 * * * if ! out=`ansible-playbook /etc/ansible/playbooks/reboot.yml`; 
> then echo $out; fi
> 14 12 * * * /bin/ansible-playbook /etc/ansible/playbooks/reboot.yml >> 
> /var/tmp/reboot.log  >/dev/null 2>&1
>
> Any ideas please?
> Regards
> Tariq
>
>

-- 
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/269e0361-507e-4294-bc26-aef4e5dd4783%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to