On Mon, 28 Sep 2020 at 19:02, Tony Wong <tdubb...@gmail.com> wrote:
>
>
> this is all i have for ubuntu system. please advise

What advice are you looking for?




>
>
>
> ---
> - hosts: ubuntu
>   become: true
>   become_user: root
>   tasks:
>     - name: Update apt repo/cache
>       apt: update_cache=yes
>       force_apt_get=yes
>       cache_valid_time=3600
>
>     - name: Upgrade all packages on servers
>       apt: upgrade=dist
>       force_apt_get=yes
>
>     - name: Check if a reboot is needed on all servers
>       register: reboot_required_file
>       stat: path=/var/run/reboot-required get_md5=no
>
>     - name: Reboot the box if kernel updated
>       reboot:
>         msg: "Reboot initiated by Ansible for kernel updates"
>         connect_timeout: 5
>         reboot_timeout: 300
>         pre_reboot_delay: 0
>         post_reboot_delay: 30
>         test_command: uptime
>       when: reboot_required_file.stat.exists
>
> On Saturday, September 26, 2020 at 2:09:25 PM UTC-7 
> yt000...@northernmunky.dontexist.net wrote:
>>
>> You can simply plagiarize the Ansible docs for yum to upgrade
>> https://docs.ansible.com/ansible/latest/collections/ansible/builtin/yum_module.html
>>
>> and apt  to upgrade
>> https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html
>>
>> however this is all dependent on your requirements, I use a precheck, 
>> upgrade, changelog collection of playbooks with host logic for the Linux 
>> hosts I currently maintain, depends on your estate.
>>
>> On Thursday, September 24, 2020 at 6:57:38 PM UTC+1 ida...@gmail.com wrote:
>>>
>>> I suggest taking a look at the service module
>>> https://docs.ansible.com/ansible/latest/collections/ansible/builtin/service_module.html
>>> You can use this module to update both YUM and APT packages.
>>>
>>> Some packages have different names, so be sure to take that into account.
>>> You can see an example here:
>>> https://youtu.be/CYghlf-6Opc?t=929
>>>
>>> On Thursday, September 24, 2020 at 8:39:16 PM UTC+3 tdub...@gmail.com wrote:
>>>>
>>>> how can i update both ubuntu and centos boxes all in one playbook?
>
> --
> 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-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/3558608e-741f-4a75-96c9-e014b57bba1fn%40googlegroups.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPA7W87fxT4_xSZURLnp0OswLUjbS-B3sjZ4f5T4_iidw%40mail.gmail.com.

Reply via email to