Re: [ansible-devel] How to run entire playbook sequential against inventory

14 views
Skip to first unread message
Message has been deleted

Mike Sawyers

unread,
Aug 22, 2020, 8:14:09 AM8/22/20
to jonin, Ansible Development
Hi Jonin,

Sound like you have something like this and you want to group and batch the hosts?

---
   name: first webservers play
   hosts: Webservers
   tasks

  name: Nodes play
  hosts: nodes
  tasks

  name: Post nodes tasks
  hosts: webservers
  tasks


If I'm not misunderstanding that sounds like you want rolling updates. Have you looked at this page yet?

On Sat, Aug 22, 2020 at 4:47 AM jonin <sebastia...@gmail.com> wrote:
Hi,

I have a playbook which is running against this type of structured inventory file

# Ansible Inventory
[webservers]
host1
host2

[nodes]
host3
host4

[all:vars]
#############################

The playbook needs to effectively run three plays in this order which it is doing:
1. Do stuff to Webservers
2. Do stuff tot Nodes
3. Do stuff to webservers

Currently when I run this playbook there is  a complete outage on all hosts as plays are executed.

I want to be able to run my playbook so that there is only a partial outage i.e. first running the entire play against Webserver1(host1) /node1(host3) before repeating the same steps against webserver2(host2)/node2(host4).

I have read about the use of serial but I think this would only help for orchestrating the order of execution within a play as opposed to whole playbook? 

Any help much appreciated. 

--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/86a40246-37f1-4cb4-a5dd-10cd2540dd05n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages