Re: [ansible-project] Reboot servers strategy.

2020-07-02 Thread Moritz Kobel
Hi,

on our setup we reboot our servers groupwise.
With serial: 1 is ensured only one server is rebooted a time.
The reboot is only performed if /var/run/reboot-required exists. This
might be Debian specific. This 'when' condition could give you an idea
how to handle server specific facts.

--8<
- hosts:
- sensu_servers
- build_servers
- db_servers
- lamp_servers
- app_servers
- mail_servers
- web_servers
  become: true
  serial: 1
  tasks:
- name: check if reboot-required exists
  stat:
path: /var/run/reboot-required
  register: reboot_required
- name: reboot
  reboot:
  when: reboot_required.stat.exists
--8<

Check out the reboot module for further parameters like
'post_reboot_delay' or 'test_command':
https://docs.ansible.com/ansible/latest/modules/reboot_module.html

I hope this helps.


-- Moritz

Am Mittwoch den 01. Juli 2020 schrieb Rafael Tomelin:

> Hi,
> 
> I get all servers from Azure and created inventory in memory by ansible.
> After get server and created inventory, connect in all servers collection
> facts and execute update of servers.  This moment I need to create a
> process to reboot my servers by custom facts.
> 
> 
> On Tue, Jun 30, 2020 at 4:53 PM John Petro  wrote:
> 
> > Are you using ansible to apply updates and reboot now?  If so, what does
> > your current process look like?
> >
> > --john
> >
> > On Mon, Jun 29, 2020 at 3:26 PM Rafael Tomelin 
> > wrote:
> >
> >>
> >> Hi Guys,
> >> I have periodic updates on all RedHat servers at the same time, I need to
> >> create a strategy to restart my clusters because I can't stop my
> >> application and services.
> >>
> >> How to create the reboot strategy server-per-server in clusters?
> >>
> >>
> >> --
> >> Atenciosamente,
> >>
> >> Rafael Tomelin
> >> Tel.: 51-984104084
> >> Skype: rafael.tomelin
> >>
> >> LPI ID: LPI000191271
> >> Red Hat Certified Engineer
> >> Puppet Professional 2017 Certification
> >>
> >> --
> >> 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/CAGEUqbAwBVcpuWsULocMZ2ts4-298wqjmkkEvhRhRSDaFdnHPQ%40mail.gmail.com
> >> 
> >> .
> >>
> > --
> > 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/CAPAjob-WzDS9BXVnGCvhS%3DXS%2B179f7mf-nJEbMQA-5-4_kZtmA%40mail.gmail.com
> > 
> > .
> >
> 
> 
> -- 
> Atenciosamente,
> 
> Rafael Tomelin
> Tel.: 51-984104084
> Skype: rafael.tomelin
> 
> LPI ID: LPI000191271
> Red Hat Certified Engineer
> Puppet Professional 2017 Certification
> 
> -- 
> 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/CAGEUqbCehhAhS6c-H40Dx5bPLfX5mJEF9Zkc%2BdocnpKnpYB8SQ%40mail.gmail.com.

-- 
   <\ __@  __@
 \ __   _-\<, -\<,_
http://www.tandemblog.ch 0<==`-(-)/---|/-(_)

-- 
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/20200702111940.GA3727695%40moturau.office.itds.ch.


Re: [ansible-project] Reboot servers strategy.

2020-07-01 Thread John Petro
Hmm...  I have seen where someone put a delay in the task that does the
reboot.  So you could probably do something like that, to make sure that
the node is back up before moving on, or you could do some sort of check
and register a variable, so that a node would only reboot if that node is
set.

On Wed, Jul 1, 2020 at 6:36 AM Rafael Tomelin 
wrote:

> Hi,
>
> I get all servers from Azure and created inventory in memory by ansible.
> After get server and created inventory, connect in all servers collection
> facts and execute update of servers.  This moment I need to create a
> process to reboot my servers by custom facts.
>
>
> On Tue, Jun 30, 2020 at 4:53 PM John Petro  wrote:
>
>> Are you using ansible to apply updates and reboot now?  If so, what does
>> your current process look like?
>>
>> --john
>>
>> On Mon, Jun 29, 2020 at 3:26 PM Rafael Tomelin 
>> wrote:
>>
>>>
>>> Hi Guys,
>>> I have periodic updates on all RedHat servers at the same time, I need
>>> to create a strategy to restart my clusters because I can't stop my
>>> application and services.
>>>
>>> How to create the reboot strategy server-per-server in clusters?
>>>
>>>
>>> --
>>> Atenciosamente,
>>>
>>> Rafael Tomelin
>>> Tel.: 51-984104084
>>> Skype: rafael.tomelin
>>>
>>> LPI ID: LPI000191271
>>> Red Hat Certified Engineer
>>> Puppet Professional 2017 Certification
>>>
>>> --
>>> 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/CAGEUqbAwBVcpuWsULocMZ2ts4-298wqjmkkEvhRhRSDaFdnHPQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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/CAPAjob-WzDS9BXVnGCvhS%3DXS%2B179f7mf-nJEbMQA-5-4_kZtmA%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Atenciosamente,
>
> Rafael Tomelin
> Tel.: 51-984104084
> Skype: rafael.tomelin
>
> LPI ID: LPI000191271
> Red Hat Certified Engineer
> Puppet Professional 2017 Certification
>
> --
> 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/CAGEUqbCehhAhS6c-H40Dx5bPLfX5mJEF9Zkc%2BdocnpKnpYB8SQ%40mail.gmail.com
> 
> .
>

-- 
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/CAPAjob-GOCjJF_V_KZo5-YUW77eP9v0Up6nfUdRPSAqKH-8gaQ%40mail.gmail.com.


Re: [ansible-project] Reboot servers strategy.

2020-07-01 Thread Rafael Tomelin
Hi,

I get all servers from Azure and created inventory in memory by ansible.
After get server and created inventory, connect in all servers collection
facts and execute update of servers.  This moment I need to create a
process to reboot my servers by custom facts.


On Tue, Jun 30, 2020 at 4:53 PM John Petro  wrote:

> Are you using ansible to apply updates and reboot now?  If so, what does
> your current process look like?
>
> --john
>
> On Mon, Jun 29, 2020 at 3:26 PM Rafael Tomelin 
> wrote:
>
>>
>> Hi Guys,
>> I have periodic updates on all RedHat servers at the same time, I need to
>> create a strategy to restart my clusters because I can't stop my
>> application and services.
>>
>> How to create the reboot strategy server-per-server in clusters?
>>
>>
>> --
>> Atenciosamente,
>>
>> Rafael Tomelin
>> Tel.: 51-984104084
>> Skype: rafael.tomelin
>>
>> LPI ID: LPI000191271
>> Red Hat Certified Engineer
>> Puppet Professional 2017 Certification
>>
>> --
>> 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/CAGEUqbAwBVcpuWsULocMZ2ts4-298wqjmkkEvhRhRSDaFdnHPQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAPAjob-WzDS9BXVnGCvhS%3DXS%2B179f7mf-nJEbMQA-5-4_kZtmA%40mail.gmail.com
> 
> .
>


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbCehhAhS6c-H40Dx5bPLfX5mJEF9Zkc%2BdocnpKnpYB8SQ%40mail.gmail.com.


Re: [ansible-project] Reboot servers strategy.

2020-06-30 Thread John Petro
Are you using ansible to apply updates and reboot now?  If so, what does
your current process look like?

--john

On Mon, Jun 29, 2020 at 3:26 PM Rafael Tomelin 
wrote:

>
> Hi Guys,
> I have periodic updates on all RedHat servers at the same time, I need to
> create a strategy to restart my clusters because I can't stop my
> application and services.
>
> How to create the reboot strategy server-per-server in clusters?
>
>
> --
> Atenciosamente,
>
> Rafael Tomelin
> Tel.: 51-984104084
> Skype: rafael.tomelin
>
> LPI ID: LPI000191271
> Red Hat Certified Engineer
> Puppet Professional 2017 Certification
>
> --
> 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/CAGEUqbAwBVcpuWsULocMZ2ts4-298wqjmkkEvhRhRSDaFdnHPQ%40mail.gmail.com
> 
> .
>

-- 
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/CAPAjob-WzDS9BXVnGCvhS%3DXS%2B179f7mf-nJEbMQA-5-4_kZtmA%40mail.gmail.com.


[ansible-project] Reboot servers strategy.

2020-06-29 Thread Rafael Tomelin
Hi Guys,
I have periodic updates on all RedHat servers at the same time, I need to
create a strategy to restart my clusters because I can't stop my
application and services.

How to create the reboot strategy server-per-server in clusters?


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbAwBVcpuWsULocMZ2ts4-298wqjmkkEvhRhRSDaFdnHPQ%40mail.gmail.com.