also i want to know how to break this into a role instead

On Mon, Sep 28, 2020 at 10:29 AM Tony Wong <tdubb...@gmail.com> wrote:

> advice. Need to add the yum part for centos
>
> need some examples
>
> On Monday, September 28, 2020 at 10:28:23 AM UTC-7 dick....@geant.org
> wrote:
>
>> On Mon, 28 Sep 2020 at 19:02, Tony Wong <tdub...@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-proje...@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 a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/vi_MG4aR2uA/unsubscribe.
> To unsubscribe from this group and all its topics, 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/3d5b1e16-1cbd-46ad-8086-a983d6d29e99n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/3d5b1e16-1cbd-46ad-8086-a983d6d29e99n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CALmkhkpiT2tCkwC5GNi%3DrVQF6_4tkwuZpgrgxO1kezZEDsYG6Q%40mail.gmail.com.

Reply via email to