In Ansible, is there a way to make deployment in a specific order? -


i’m using ansible since few months now, , have little issue deployment order on different hosts.

i have 8 servers:

  • 4 reverse proxy apache
  • 4 tomcat servers

when make deployments on these servers, have stop first apache perform deployment on first tomcat. when tomcat1 done, have start apache1. after continue same deployments on servers.

if hosts file is:

[apache-servers] apache1 apache2 apache3 apache4  [tomcat-servers] tomcat1 tomcat2 tomcat3 tomcat4 

then, ansible stops apaches, tomcats, makes deployment, , restarts all.

so, have found trick want. have run shell script rewrite host file before running ansible-playbooks.

is there better way same?

use serial: 1 in play , run play on 1 host @ time.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -