Playbooks are a completely different way to use ansible and are particularly awesome.
They are the basis for a really simple configuration management and deployment system, unlike any that already exist, and one that is very well suited to deploying complex multi-machine applications. While you might run the main ansible program for ad-hoc tasks, playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec.
Playbooks are a completely different way to use ansible and are particularly awesome. They are the basis for a really simple configuration management and deployment system, unlike any that already exist, and one that is very well suited to deploying complex multi-machine applications. While you might run the main ansible program for ad-hoc tasks, playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec.
Playbook Example
````````````````
Playbooks are expressed in YAML format and have a minimum of syntax. Each playbook is composed
of one or more patterns in a list. By composing a playbook of multiple patterns, it is possible
of one or more 'plays' in a list. By composing a playbook of multiple 'plays', it is possible
to orchestrate multi-machine deployments, running certain steps on all machines in
the webservers group, then certain steps on the database server group, then more commands
<h2>Communicate and Get Involved<aclass="headerlink"href="#communicate-and-get-involved"title="Permalink to this headline">¶</a></h2>
<ulclass="simple">
<li>Join the <aclass="reference external"href="http://groups.google.com/group/ansible-project">ansible-project mailing list</a> on Google Groups</li>
<li>Join <aclass="reference external"href="irc://irc.freenode.net/#ansible">#ansible</a> on the <aclass="reference external"href="http://freenode.net/">freenode IRC network</a></li>
<li>Visit the <aclass="reference external"href="https://github.com/ansible/ansible">project page</a> on Github<ul>
<li>View the <aclass="reference external"href="https://github.com/ansible/ansible/issues">issue tracker</a></li>
</ul>
</li>
</ul>
</div>
</div>
<divclass="section"id="contents">
<h1>Contents<aclass="headerlink"href="#contents"title="Permalink to this headline">¶</a></h1>
...
...
@@ -99,17 +110,13 @@ get involved.</p>
<liclass="toctree-l2"><aclass="reference internal"href="gettingstarted.html#your-first-commands">Your first commands</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="playbooks.html">Playbooks: Ansible for Deployment, Configuration Management, and Orchestration</a><ul>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>ansible-modules</title><linkrel="stylesheet"href="./docbook-xsl.css"type="text/css"/><metaname="generator"content="DocBook XSL Stylesheets V1.75.2"/></head><body><divxml:lang="en"class="refentry"title="ansible-modules"lang="en"><aid="id326412"></a><divclass="titlepage"></div><divclass="refnamediv"><h2>Name</h2><p>ansible-modules — stock modules shipped with ansible</p></div><divclass="refsect1"title="DESCRIPTION"><aid="_description"></a><h2>DESCRIPTION</h2><p>Ansible ships with a number of modules that can be executed directly on remote hosts or through
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>ansible-modules</title><linkrel="stylesheet"href="./docbook-xsl.css"type="text/css"/><metaname="generator"content="DocBook XSL Stylesheets V1.75.2"/></head><body><divxml:lang="en"class="refentry"title="ansible-modules"lang="en"><aid="id372014"></a><divclass="titlepage"></div><divclass="refnamediv"><h2>Name</h2><p>ansible-modules — stock modules shipped with ansible</p></div><divclass="refsect1"title="DESCRIPTION"><aid="_description"></a><h2>DESCRIPTION</h2><p>Ansible ships with a number of modules that can be executed directly on remote hosts or through
ansible playbooks.</p></div><divclass="refsect1"title="IDEMPOTENCE"><aid="_idempotence"></a><h2>IDEMPOTENCE</h2><p>Most modules other than command are idempotent, meaning they will seek to avoid changes
unless a change needs to be made. When using ansible playbooks, these modules can
trigger change events, as described in <spanclass="strong"><strong>ansible-playbooks</strong></span>(5).</p><p>Unless otherwise noted, all modules support change hooks.</p></div><divclass="refsect1"title="command"><aid="_command"></a><h2>command</h2><p>The command module takes the command name followed by a list of arguments, space delimited.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>ansible-modules</title><linkrel="stylesheet"href="./docbook-xsl.css"type="text/css"/><metaname="generator"content="DocBook XSL Stylesheets V1.75.2"/></head><body><divxml:lang="en"class="refentry"title="ansible-modules"lang="en"><aid="id532031"></a><divclass="titlepage"></div><divclass="refnamediv"><h2>Name</h2><p>ansible-playbook — format and function of an ansible playbook file</p></div><divclass="refsect1"title="DESCRIPTION"><aid="_description"></a><h2>DESCRIPTION</h2><p>Ansible ships with <spanclass="emphasis"><em>ansible-playbook</em></span>, a tool for running playbooks.
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>ansible-modules</title><linkrel="stylesheet"href="./docbook-xsl.css"type="text/css"/><metaname="generator"content="DocBook XSL Stylesheets V1.75.2"/></head><body><divxml:lang="en"class="refentry"title="ansible-modules"lang="en"><aid="id447346"></a><divclass="titlepage"></div><divclass="refnamediv"><h2>Name</h2><p>ansible-playbook — format and function of an ansible playbook file</p></div><divclass="refsect1"title="DESCRIPTION"><aid="_description"></a><h2>DESCRIPTION</h2><p>Ansible ships with <spanclass="emphasis"><em>ansible-playbook</em></span>, a tool for running playbooks.
Playbooks can represent frequent tasks, desired system configurations,
or deployment processes.</p></div><divclass="refsect1"title="FORMAT"><aid="_format"></a><h2>FORMAT</h2><p>Playbooks are written in YAML.</p></div><divclass="refsect1"title="EXAMPLE"><aid="_example"></a><h2>EXAMPLE</h2><p>See:</p><divclass="itemizedlist"><ulclass="itemizedlist"type="disc"><liclass="listitem">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>ansible</title><linkrel="stylesheet"href="./docbook-xsl.css"type="text/css"/><metaname="generator"content="DocBook XSL Stylesheets V1.75.2"/></head><body><divxml:lang="en"class="refentry"title="ansible"lang="en"><aid="id320915"></a><divclass="titlepage"></div><divclass="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><divclass="refsynopsisdiv"title="Synopsis"><aid="_synopsis"></a><h2>Synopsis</h2><p>ansible <host-pattern> [-f forks] [-m module_name] [-a args]</p></div><divclass="refsect1"title="DESCRIPTION"><aid="_description"></a><h2>DESCRIPTION</h2><p><spanclass="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>ansible</title><linkrel="stylesheet"href="./docbook-xsl.css"type="text/css"/><metaname="generator"content="DocBook XSL Stylesheets V1.75.2"/></head><body><divxml:lang="en"class="refentry"title="ansible"lang="en"><aid="id490114"></a><divclass="titlepage"></div><divclass="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><divclass="refsynopsisdiv"title="Synopsis"><aid="_synopsis"></a><h2>Synopsis</h2><p>ansible <host-pattern> [-f forks] [-m module_name] [-a args]</p></div><divclass="refsect1"title="DESCRIPTION"><aid="_description"></a><h2>DESCRIPTION</h2><p><spanclass="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
<h1>The Inventory File, Patterns, and Groups<aclass="headerlink"href="#the-inventory-file-patterns-and-groups"title="Permalink to this headline">¶</a></h1>
<h1>Playbooks: Ansible for Deployment, Configuration Management, and Orchestration<aclass="headerlink"href="#playbooks-ansible-for-deployment-configuration-management-and-orchestration"title="Permalink to this headline">¶</a></h1>
<dt><aclass="reference internal"href="patterns.html"><em>The Inventory File, Patterns, and Groups</em></a></dt>
<dd>Learn about how to select hosts</dd>
</dl>
</div>
<p>Playbooks are a completely different way to use ansible and are particularly awesome.</p>
<p>They are the basis for a really simple configuration management and deployment system, unlike any that already exist, and one that is very well suited to deploying complex multi-machine applications. While you might run the main ansible program for ad-hoc tasks, playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec.</p>
<p>Playbooks are a completely different way to use ansible and are particularly awesome. They are the basis for a really simple configuration management and deployment system, unlike any that already exist, and one that is very well suited to deploying complex multi-machine applications. While you might run the main ansible program for ad-hoc tasks, playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec.</p>
<divclass="section"id="playbook-example">
<h2>Playbook Example<aclass="headerlink"href="#playbook-example"title="Permalink to this headline">¶</a></h2>
<p>Playbooks are expressed in YAML format and have a minimum of syntax. Each playbook is composed
of one or more patterns in a list. By composing a playbook of multiple patterns, it is possible
of one or more ‘plays’ in a list. By composing a playbook of multiple ‘plays’, it is possible
to orchestrate multi-machine deployments, running certain steps on all machines in
the webservers group, then certain steps on the database server group, then more commands
<p>These variables will be pushed down to the managed systems for use in templating operations.</p>
<p>These variables will be pushed down to the managed systems for use in templating operations, where
the way to dereference them in templates is exactly the same.</p>
<p>Further, if there are discovered variables about the system (say, if facter or ohai were
installed) these variables bubble up back into the playbook, and can be used on each
system just like explicitly set variables. Facter variables are prefixed with ‘facter’
and Ohai variables are prefixed with ‘ohai’.</p>
system just like explicitly set variables. Facter variables are prefixed with ‘<ahref="#id1"><spanclass="problematic"id="id2">facter_</span></a>‘
and Ohai variables are prefixed with ‘<ahref="#id3"><spanclass="problematic"id="id4">ohai_</span></a>‘.</p>
</div>
<divclass="section"id="tasks-list">
<h2>Tasks list<aclass="headerlink"href="#tasks-list"title="Permalink to this headline">¶</a></h2>
<p>Tasks are executed in order, one at a time, against all machines matched by the host
pattern, before moving on to the next task. Failed tasks are taken out of the rotation.</p>
</div>
<divclass="section"id="task-name-and-comment">
<h2>Task name and comment<aclass="headerlink"href="#task-name-and-comment"title="Permalink to this headline">¶</a></h2>
<p>Each task has a name (required) and optional comment. This is for informational purposes only</p>
</div>
<divclass="section"id="task-action">
<h2>Task action<aclass="headerlink"href="#task-action"title="Permalink to this headline">¶</a></h2>
<p>Each play contains a list of tasks. Tasks are executed in order, one at a time, against
all machines matched by the play’s host pattern, before moving on to the next task.
Hosts with failed tasks are taken out of the rotation for the entire playbook. If things fail,
correct the problem and rerun. Modules other than command are idempotent, meaning if you
run them again, they will make the changes they are told to make to bring the system to
the desired state.</p>
</div>
<divclass="section"id="task-name-and-action">
<h2>Task name and action<aclass="headerlink"href="#task-name-and-action"title="Permalink to this headline">¶</a></h2>
<p>Every task must have a name, which is included in the output from running the playbook.</p>
<p>The action line is the name of an ansible module followed by parameters. Usually these
are expressed in key=value form, except for the command module, which looks just like a Linux/Unix
command line. See the module documentation for more info.</p>
...
...
@@ -172,13 +160,12 @@ Variables passed in can be deferenced like this:</p>
<divclass="sphinxsidebarwrapper">
<h3><ahref="index.html">Table Of Contents</a></h3>
Search.setIndex({objects:{},terms:{all:[0,1,2,4,5,6,8],code:[1,2,8],donec:[],mcollect:1,prefix:[2,4,8],rhoncu:[],lacu:[],follow:[6,2,4],scp:8,nunc:[],bubbl:4,depend:2,fusc:[],program:[1,2,4],certain:4,vel:[],blindingli:1,spec:4,sourc:[1,2,4,8],everi:5,string:2,fals:[5,2],consequat:[],failur:[7,2],veri:[1,7,4],affect:4,risu:[],luctu:[],magic:6,level:[5,2],id_rsa:[0,8],list:[1,2,3,4,5,6,8,9],vivamu:[],item:5,ansible_librari:[],form:[5,4],dotnet:5,saltstack:1,mpdehaan:[],phasellu:[],ornar:[],natur:2,seper:4,chef:1,second:5,design:1,pass:4,eleifend:[],further:4,even:8,what:2,diam:[],favcolor:8,section:[1,4],abl:[],nec:[],abbrevi:5,version:[2,8],directori:2,ever:1,method:7,metadata:2,tar:0,suscipit:[],hash:2,eckersberg:5,here:[],leo:[],address:[6,2],path:2,sinc:8,valu:[5,2,4],aliquam:[],scelerisqu:[],great:1,purpos:[2,4],larger:[],host:[0,1,2,4,6,7,8],adipisc:[],prior:2,venenati:[],permit:5,action:[1,2,4],nulla:[],implement:7,iaculi:[],via:[0,1],regardless:[5,1],dictionari:5,accumsan:[],extra:4,apach:[4,8],modul:[0,1,2,4,7,8],prefer:[],put:[0,8],unix:4,api:[1,7,2],instal:[8,0,2,4,1],select:[6,4],httpd:4,from:[0,1,2,4,5,8],describ:2,would:8,commun:[1,3],visit:3,two:[5,0,6],noarch:0,dehaan:1,call:2,usr:[2,8],taken:4,sagitti:[],basi:4,checkout:2,until:0,more:[0,6,2,4,1],desir:[],idempot:[1,2,4],dbserver:[6,4],sbin:[2,8],agent:[0,8],particular:1,easiest:1,must:[5,2],none:[],join:3,ibm:[],module_arg:7,habitass:[],setup:[1,2,8],work:[6,8],critic:1,remain:1,tag:[0,2],can:[0,1,2,4,5,6,7,8],learn:[0,6,4,1],ero:[],root:[5,1,2,4],pick:5,employe:5,myapp:8,yamllint:5,ultric:[],process:[1,8],rpath:[],sudo:0,share:2,templat:[8,0,2,4,1],othervar:4,knows_oop:5,minimum:4,want:7,occur:4,nullam:[],alwai:2,multipl:[6,4,8],newlin:5,puru:[],sit:[],capistrano:1,ping:[0,7,2,1],write:[5,1,2,4,8],how:[0,1,2,4,5,6,7],etiam:[],yum:[1,2],simpl:[5,1,7,4,8],updat:8,arcu:[],express:[5,1,7,4],referenc:[6,4],clone:0,usabl:1,tristiqu:[],mai:[5,0],end:2,data:[5,7,2,8],parallel:[1,8],man:[1,9],repo:[2,8],github:[0,3],orchestr:[1,4],read:[5,0],bootstrap:1,favorit:1,turpi:[],element:[5,2],issu:3,inform:[2,4],mango:5,combin:5,asynchron:[1,4],order:4,talk:[],oper:[1,4,8],help:1,over:1,move:[2,4],orang:5,becaus:[],elit:5,rpmbuild:0,comma:5,vita:[],still:[],paramet:[2,4],jid:8,overlord:0,group:[1,7,3,4,6],cli:7,fit:[],yaml:[5,0,4,1],pend:[4,8],rapidli:7,infrastructur:[1,6],mail:[6,3],sapien:[],main:4,might:4,easier:[],non:[1,2],"return":[1,7,2],thei:[7,2,4,8],food:5,alist:4,nibh:[],egesta:[],"break":[],framework:[1,7],jinja2:[0,2,8],now:[0,2],nor:2,choic:1,multiprocess:0,name:[5,1,2,4],anyth:2,neccessari:[2,8],config:[1,4],viverra:[],datastructur:7,porta:[],separ:5,each:[5,2,4,8],stock:[],nearli:4,mean:2,metu:[],michael:1,auctor:[],realli:[5,4],contributor:[],backport:0,connect:[],our:5,todo:[],event:2,out:[5,1,2,4],variabl:[2,4,8],"try":0,shown:[],network:3,space:[1,2],reboot:8,content:[0,1],stuff:8,sshd:1,internet:1,correct:[5,1],red:8,state:[2,4,8],hendrerit:[],ntp:8,contain:[2,4],differ:[1,4,8],pub:8,control:[1,2,4,8],base:[1,4],lab:[],tempu:[],qui:[],org:0,molli:[],bash:[0,8],care:[],vestibulum:[],pyyaml:0,indent:5,maecena:[],could:7,fqdn:8,thing:[1,6],place:1,isn:1,principl:[],licens:1,first:[0,2,8,1],origin:[],softwar:[1,2],rang:1,notifi:[1,4,8],obviou:1,onc:2,number:2,yourself:0,hook:2,instruct:0,alreadi:[2,4],puppet:1,fast:1,enim:[],massiv:1,open:1,straight:8,given:8,convent:2,script:[0,1,4,5,7,8],associ:5,top:2,system:[0,1,2,4,6,8],messag:7,grow:[],too:1,statement:[1,4],molesti:[],john:5,banana:5,includ:[1,4],shell:[1,8],option:[5,9,2,4,8],tool:1,copi:[1,2,8],specifi:[5,2,8],quam:[],next:4,"short":1,kept:4,than:[0,2,8],serv:[],liter:2,target:[1,6],provid:5,sollicitudin:[],heavyweight:[],structur:5,charact:5,project:[0,3,8,1],architect:1,were:4,minut:[],uses_cv:5,pre:0,sai:4,runner:7,ani:[1,7,2,4,8],ant:[],download:0,have:[0,2,4,1],need:[5,0,2,8],tellu:[],seek:2,paramiko:0,engin:8,built:0,contact:[0,7,2],note:[2,8],also:[0,1,2,4,5,6,8],client:1,massa:[],build:[0,7],indic:2,environ:[],divers:1,pulvinar:[],begin:5,sure:[],unless:2,distribut:[0,1],deploy:[1,4],track:8,who:2,discov:4,most:[5,2],plai:2,regular:4,plan:2,deploi:[1,2,4,8],pair:2,why:1,porttitor:[],simplic:[],doc:1,later:8,cover:8,doe:[1,2,6],sodal:[],bracket:5,snapshot:2,clojur:[],wildcard:[1,6],dolor:[],someth:[1,8],awesom:[1,4],laoreet:[],blandit:[],verbos:2,syntax:[5,0,4],bring:[],directli:[2,4,8],raleigh:1,particularli:4,playbook:[0,1,2,4,5,6,7,8],permiss:2,hack:1,radic:1,pki:[],trivial:2,varnam:4,involv:[1,3],absolut:2,onli:[2,4],explicitli:4,locat:2,just:[8,0,4,1],pretti:7,configur:[5,0,6,4,1],releas:0,written:[1,2,4,8],should:[5,2],consectetur:[],somevar:4,congratul:0,variu:[],local:2,yml:4,long_running_oper:8,contribut:1,variou:[],get:[5,0,3,8,1],financ:1,stop:2,mission:1,bibendum:[],ssl:[],ssh:[0,8],malesuada:[],requir:[0,2,4,1],uvh:0,nisi:[],bar:6,lame:5,nisl:[],remot:[0,2,4,8],cra:[],orci:[],through:[0,2,1],where:[1,2,4],wrote:[],view:[3,9],set:[2,4],creator:[],elimin:[],see:[0,1,2,4,5,6,8],sed:[],result:[7,2],fail:4,sem:[],extend:1,ntp_server:8,faucibu:[],statu:8,kei:[5,0,2,4],databas:4,modularli:[],discoveri:2,restart:[2,4,8],behind:[],won:8,languag:[5,0,6,2,1],between:5,"import":7,irc:3,altern:8,elementum:[],manpag:[0,9],handful:[],aspir:[],style:2,job:[5,8],aserv:0,magna:[],webapp:8,amet:[],addit:[5,1],delimit:2,plugin:[],goal:1,against:[1,4,6],tempor:[],etc:[0,1,2,4,6,8],befor:[2,4],mani:8,placerat:[],com:[0,7,4,6],proin:[],sha:2,assur:4,simpli:2,author:1,overview:5,format:[2,4,8],inspir:[],colon:4,shutdown:2,linux:[1,4],poll:[1,4,8],rpm:[0,1],matti:[],dui:[],pretium:[],multiplay:1,morbi:[],three:6,been:[1,2],json:[1,7,2],much:1,basic:[5,0,6,2,1],ungroup:6,feugiat:[],quickli:[5,1],box:[1,2],fire:1,rubi:[5,2,8],vulput:[],argument:2,understand:0,pellentesqu:[],func:1,atlanta:8,job_statu:8,those:[5,2],emploi:5,authorized_kei:0,multi:[1,4],tortor:[],look:[6,4,8],nequ:[],hoc:[1,4],servic:[1,2,4],md5sum:2,batch:[],"while":4,overrid:2,ipsum:[],cobbler:1,real:0,motd:8,max_client:4,them:8,erat:[],conf:[4,8],module_nam:7,ship:[0,2],sever:5,http_port:4,develop:[5,0,1],inventori:[6,2],minim:0,make:[0,2,8],platea:[],same:[5,6,2,8],member:5,python:[0,1,2,5,7,8],complex:[1,4],success:2,fedora:[],document:[0,7,4],ansibl:[0,1,2,3,4,5,6,7,8,9],complet:[0,4],finish:[],http:2,webserv:[6,4,8],nest:2,painless:1,effect:4,dai:[],fruit:5,user:[1,2,4],ownership:[],extrem:0,php:8,distutil:[0,1],chang:[2,4,8],squar:5,exceedingli:[],task:[1,4,8],off:1,scenario:2,whole:[],well:[2,4],spent:[],exampl:[0,1,2,4,5,6,7,8],command:[0,1,2,4,6,8,9],thi:[0,1,2,4,5,6,8],choos:2,usual:4,comment:[1,4],protocol:2,execut:[1,2,4],less:[0,1],when:[2,4,8],skill:5,simultan:8,ligula:[],previous:[],web:[7,8],versu:1,easi:2,mix:[1,6],trigger:2,hac:[],except:4,littl:1,add:[0,8],other:[1,2,8],els:1,unlik:4,hat:[],match:4,take:2,bin:[2,8],applic:[7,4],which:[0,1,2,4,5,6],ohai:[1,2,4,8],dest:[2,4,8],tincidunt:[],dark:7,game:1,know:5,background:[1,8],world:0,bit:2,daemon:1,like:[5,6,4,8],specif:[1,7,8,6],signal:4,manual:[],integ:2,server:[1,2,4,8],edit:0,"boolean":5,either:2,velit:[],popular:1,async:[],page:[5,0,9,3,1],deal:[],suppli:2,some:0,back:4,dead:1,tumblr:[],home:[],librari:[],tmp:8,render:2,avoid:2,though:1,ultrici:[],per:7,tracker:3,unit:[],pattern:[1,7,4,6],foo:[6,4,8],complic:1,machin:[0,2,4,8],core:1,run:[0,7,2,4,8],power:[1,7],quit:[],lose:8,usag:[2,8],asciidoc:0,web2:7,step:[2,4],web1:7,repositori:0,"super":1,aenean:[],simpler:8,comparison:1,about:[5,0,2,4,1],gplv3:1,justo:[],libero:[],surround:5,manag:[5,0,6,4,1],srv:[4,8],quisqu:[],industri:1,own:[1,2,4],"final":5,bounc:2,automat:2,compos:4,down:4,ensur:4,perl:8,bserver:0,your:[0,1,2,4,5,6,8],praesent:[],git:[0,2,8,1],type:7,fabric:1,wai:[5,0,4,8],interdum:[],transfer:[1,8],dictum:[],support:[2,8],rotat:4,"long":[1,2,8],avail:[0,9,2,4,8],start:[5,0,2,4,1],appl:5,augu:[],lot:[1,8],suit:4,"var":[1,4],individu:6,fork:7,head:[2,8],doctyp:[],simplejson:0,eget:[],handler:[1,4,8],lint:5,msg:2,loborti:[],ullamcorp:[],line:[5,1,9,4,8],"true":[5,2],freenod:3,info:4,strawberri:5,made:[2,8],possibl:[6,4,8],whether:7,wish:[5,0,6],tell:[2,8],planet:1,record:5,below:8,limit:[1,8],suspendiss:[],otherwis:2,problem:[],similar:2,chip:1,facter:[1,2,4,8],curv:1,featur:[1,4],tasti:5,creat:1,lectu:[],doesn:1,repres:5,ansil:[],deferenc:4,file:[0,1,2,4,5,6,8],mauri:[],exist:[1,4],check:[2,8],urna:[],conval:[],googl:3,excel:1,nam:[],"default":[1,2,6],likes_emac:5,futur:0,dignissim:[],test:[0,2],you:[0,1,4,5,6,8],node:[0,1],dapibu:[],journei:[],gravida:[],sequenc:1,devop:1,push:4,est:[],feli:[],aliquet:[],src:[2,4,8],lorem:[],"60k":1,dictumst:[],sphinx:0,rutrum:[],anywher:[],descript:[],portion:6,time:[0,1,2,4,6,8],far:1,serious:[],fermentum:[]},objtypes:{},titles:["Getting Started","Ansible","Ansible Modules","Communicate and Get Involved","Playbooks","YAML Scripts","Patterns","API","Examples","Man Pages"],objnames:{},filenames:["gettingstarted","index","modules","communicate","playbooks","YAMLScripts","patterns","api","examples","man"]})
\ No newline at end of file
Search.setIndex({objects:{},terms:{all:[0,1,2,3,4,5,7],rhoncu:[],func:1,perl:7,mcollect:1,prefix:[2,3,7],code:[1,2,7],lacu:[],follow:[5,2,3],scp:7,nunc:[],content:[0,1],depend:2,specif:[5,6,7],program:[1,2,3],vel:[],blindingli:1,spec:3,sourc:[1,2,3,7],everi:[4,3],string:2,fals:[4,2],consequat:[],failur:[6,2],veri:[1,6,3],affect:3,risu:[],luctu:[],magic:[],max_client:3,level:[4,2],id_rsa:[0,7],list:[1,2,3,4,5,7,8],vivamu:[],item:4,ansible_librari:[],dotnet:4,saltstack:1,phasellu:[],ornar:[],natur:2,seper:3,chef:1,second:4,design:1,pass:3,eleifend:[],further:3,even:7,what:2,diam:[],favcolor:7,section:[1,3],abl:[],nec:[],abbrevi:4,version:[2,7],directori:2,ever:1,method:6,metadata:2,suscipit:[],hash:2,eckersberg:4,lectu:[],here:[],leo:[],address:[5,2],path:2,sinc:7,valu:[4,2,3],aliquam:[],scelerisqu:[],great:1,purpos:2,larger:[],step:[2,3],adipisc:[],prior:2,venenati:[],permit:4,action:[1,2,3],nulla:[],implement:6,iaculi:[],via:[0,1],regardless:[4,1],tempu:[],extra:3,modul:[0,1,2,3,6,7],prefer:[],put:[0,7],unix:3,api:[1,6,2],instal:[7,0,2,3,1],should:[4,2],select:[1,3,5],httpd:3,from:[0,1,2,3,4,7],describ:[2,3],would:7,commun:1,visit:1,two:[4,0,5],noarch:0,ohai:[1,2,3,7],dehaan:1,call:2,usr:[2,7],taken:3,sagitti:[],care:[],checkout:2,until:0,more:[0,5,2,3,1],desir:3,idempot:[1,2,3],dbserver:5,sbin:[2,7],agent:[0,7],particular:1,easiest:1,must:[4,2,3],none:[],join:1,ibm:[],module_arg:6,dest:[2,3,7],habitass:[],setup:[1,2,7],work:[5,7],critic:1,remain:1,minimum:3,can:[0,1,2,3,4,5,6,7],learn:[0,5,3,1],about:[4,0,2,3,1],ero:[],root:[4,1,2,3],employe:4,conf:[3,7],yamllint:4,ultric:[],process:[1,7],rpath:[],sudo:0,share:2,templat:[7,0,2,3,1],libero:[],knows_oop:4,liter:2,want:6,occur:3,nullam:[],alwai:2,multipl:[5,3,7],newlin:4,puru:[],sit:[],capistrano:1,ping:[0,6,2,1],write:[4,1,2,3,7],how:[0,1,2,3,4,5,6],etiam:[],place:1,config:[1,3],stock:[],arcu:[],financ:1,referenc:[5,3],clone:0,lab:[],tristiqu:[],ohai_:3,contribut:1,mai:[4,0],end:2,associ:4,grow:[],man:[1,8],bibendum:[],"short":1,orchestr:[0,1,2,3,5,7],bootstrap:1,favorit:1,turpi:[],element:[4,2],issu:1,inform:[2,3],mango:4,combin:4,order:3,talk:[],origin:[],help:1,over:1,move:[2,3],orang:4,becaus:[],elit:4,rpmbuild:0,comma:4,vita:[],still:[],paramet:[2,3],facter_:3,jid:7,overlord:0,group:[1,6,3,5],cli:6,fit:[],yaml:[4,0,3,1],pend:[3,7],rapidli:6,infrastructur:[1,5],mail:[1,5],sapien:[],main:3,might:3,easier:[],non:[1,2],"return":[1,6,2],thei:[6,2,3,7],food:4,alist:3,nibh:[],egesta:[],"break":[],framework:[1,6],jinja2:[0,2,3,7],now:[0,2],nor:2,choic:1,multiprocess:0,name:[4,1,2,3],anyth:2,neccessari:[2,7],simpl:[4,1,6,3,7],viverra:[],instruct:0,porta:[],separ:4,exampl:[0,1,2,3,4,5,6,7],each:[4,2,3,7],updat:7,mean:[2,3],metu:[],michael:1,auctor:[],render:2,realli:[4,3],ensur:3,backport:0,connect:[],our:4,todo:[],event:2,out:[4,1,2,3],variabl:[2,3,7],"try":0,shown:[],network:1,space:[1,2],reboot:7,bubbl:3,cra:[],internet:1,correct:[4,1,3],red:7,painless:1,hendrerit:[],ntp:7,orci:[],given:7,pub:7,control:[1,2,3,7],base:[1,3],usabl:1,dictionari:4,qui:[],org:0,molli:[],bash:[0,7],basi:3,vestibulum:[],pyyaml:0,indent:4,maecena:[],could:6,fqdn:7,thing:[1,3],yum:[1,2],isn:1,principl:[],licens:1,first:[0,2,7,1],oper:[1,3,7],softwar:[1,2],rang:1,notifi:[1,3,7],obviou:1,onc:2,number:2,yourself:0,hook:2,datastructur:6,alreadi:[2,3],puppet:1,"long":[1,2,7],enim:[],massiv:1,open:1,differ:[1,3,7],praesent:[],convent:2,script:[0,1,3,4,6,7],data:[4,6,2,7],top:2,system:[0,1,2,3,5,7],messag:6,parallel:[1,7],appl:4,too:1,statement:[1,3],molesti:[],john:4,banana:4,shell:[1,7],option:[4,8,2,3,7],behind:[],tool:1,copi:[1,2,7],specifi:[4,2,7],quam:[],github:[0,1],off:1,exactli:3,than:[0,2,3,7],serv:[],target:[1,5],provid:4,sollicitudin:[],heavyweight:[],structur:4,charact:4,project:[0,7,1],architect:1,were:3,minut:[],uses_cv:4,pre:0,sai:3,runner:6,argument:2,ant:[],download:0,have:[0,2,3,1],need:[4,0,2,7],tellu:[],seek:2,paramiko:0,engin:7,built:0,note:[5,2,7],also:[0,1,2,3,4,5,7],client:1,massa:[],build:[0,6],indic:2,environ:[],divers:1,pulvinar:[],begin:4,sure:[],unless:2,distribut:[0,1],deploy:[0,1,2,3,5,7],track:7,who:2,discov:3,most:[4,2],plai:[2,3],regular:3,plan:2,deploi:[1,2,3,7],pair:2,why:1,porttitor:[],simplic:[],conval:[],doc:1,later:7,cover:7,doe:[1,2,5],sodal:[],bracket:[4,5],snapshot:2,clojur:[],wildcard:5,dolor:[],modularli:[],awesom:[1,3],laoreet:[],blandit:[],verbos:2,syntax:[4,0,3],bring:3,directli:[2,3,7],raleigh:1,particularli:3,playbook:[0,1,2,3,4,5,6,7],permiss:2,hack:1,radic:1,pki:[],trivial:2,varnam:3,involv:1,absolut:2,onli:2,explicitli:3,locat:2,execut:[1,2,3],pretti:6,configur:[0,1,2,3,4,5,7],apach:[3,7],written:[1,2,3,7],accumsan:[],consectetur:[],somevar:3,freenod:1,variu:[],local:2,yml:3,long_running_oper:7,nearli:3,variou:[],get:[4,0,7,1],express:[4,1,6,3],stop:2,mission:1,repo:[2,7],ssl:[],ssh:[0,7],malesuada:[],requir:[0,2,1],uvh:0,nisi:[],bar:5,lame:4,nisl:[],remot:[0,2,3,7],stuff:7,contain:[2,3],through:[0,2,1],told:3,where:[1,2,3],wrote:[],view:[1,8],user:[1,2,3],set:[2,3],creator:[],elimin:[],see:[0,1,2,3,4,5,7],sed:[],result:[6,2],fail:3,sem:[],extend:1,servic:[1,2,3],faucibu:[],statu:7,manpag:[0,8],databas:3,someth:[1,7],discoveri:2,restart:[2,3,7],state:[2,3,7],won:7,ligula:[],between:4,"import":6,irc:1,altern:7,elementum:[],kei:[4,0,2,3],handful:[],aspir:[],style:2,job:[4,7],entir:3,aserv:0,magna:[],webapp:7,amet:[],addit:[4,1],delimit:2,plugin:[],goal:1,against:[1,3,5],tempor:[],etc:[0,1,2,3,5,7],befor:[2,3],mani:7,placerat:[],planet:1,com:[0,6,5],proin:[],sha:2,skill:4,assur:3,simpli:2,overview:4,inspir:[],header:5,colon:3,shutdown:2,linux:[1,3],poll:[1,3,7],rpm:[0,1],matti:[],dui:[],pretium:[],multiplay:1,morbi:[],three:5,been:[1,2],json:[1,6,2],much:1,far:1,basic:[4,0,5,2,1],ungroup:[],feugiat:[],quickli:[4,1],box:[1,2],wish:[4,0,5],derefer:3,fire:1,rubi:[4,2,7],vulput:[],ani:[1,6,2,3,7],likes_emac:4,understand:0,pellentesqu:[],donec:[],minim:0,atlanta:7,job_statu:7,those:[4,2],emploi:4,authorized_kei:0,multi:[1,3],tortor:[],look:[5,3,7],hoc:[1,3],straight:7,md5sum:2,batch:[],"while":3,overrid:2,ipsum:[],cobbler:1,bin:[2,7],motd:7,tar:0,them:[3,7],erat:[],myapp:7,module_nam:6,ship:[0,2],sever:4,http_port:3,develop:[4,0,1],inventori:[1,2,3,5],author:1,make:[0,2,3,7],platea:[],same:[4,5,2,3,7],member:4,python:[0,1,2,4,6,7],complex:[1,3],fedora:[],document:[0,6,3],ansibl:[0,1,2,3,4,5,6,7,8],complet:[0,3],finish:[],http:2,webserv:[5,3,7],denot:5,nest:2,pick:4,effect:3,dai:[],fruit:4,fusc:[],ownership:[],extrem:0,php:7,distutil:[0,1],chang:[2,3,7],squar:4,exceedingli:[],task:[1,3,7],kept:3,scenario:2,whole:[],well:[2,3],spent:[],contact:[0,6,2],command:[0,1,2,3,5,7,8],thi:[0,1,2,3,4,5,7],choos:2,usual:3,comment:[],protocol:2,just:[7,0,3,1],less:[0,1],excel:1,ntp_server:7,simultan:7,languag:[4,0,5,2,1],previous:[],web:[6,7],versu:1,easi:2,mix:5,hac:[],except:3,littl:1,add:[0,7],simplejson:0,els:1,unlik:3,hat:[],match:3,take:2,real:0,applic:[6,3],which:[0,1,2,3,4,5],format:[7,1,2,3,5],read:[4,0],tincidunt:[],dark:6,game:1,know:4,background:[1,7],world:0,bit:2,daemon:1,like:[4,5,3,7],success:2,signal:3,manual:[],integ:2,server:[1,2,3,7],edit:0,"boolean":4,either:2,velit:[],popular:1,async:[],page:[4,0,8,1],deal:[],suppli:2,some:0,back:3,dead:1,tumblr:[],home:[],librari:[],tmp:7,est:[],augu:[],avoid:2,though:1,ultrici:[],per:6,tracker:1,unit:[],pattern:[1,6,3,5],foo:[5,7],complic:1,machin:[0,2,3,7],core:1,run:[0,6,2,3,7],power:[1,6],quit:[],lose:7,usag:[2,7],devop:1,web2:6,host:[0,1,2,3,5,6,7],web1:6,repositori:0,output:3,"super":1,aenean:[],simpler:7,comparison:1,sshd:1,gplv3:1,justo:[],othervar:3,surround:4,manag:[0,1,2,3,4,5,7],srv:[3,7],quisqu:[],industri:1,own:[1,2,3],"final":4,bounc:2,tag:[0,2],automat:2,compos:3,down:3,contributor:[],next:3,bserver:0,your:[0,1,2,3,4,5,7],mpdehaan:[],git:[0,2,7,1],fabric:1,wai:[4,0,3,7],interdum:[],transfer:[1,7],dictum:[],support:[2,7],rotat:3,fast:1,avail:[0,8,2,3,7],start:[4,0,2,3,1],trigger:2,includ:[1,3],lot:[1,7],suit:3,"var":[1,3],individu:5,fork:6,head:[2,7],doctyp:[],form:[4,3],eget:[],handler:[1,3,7],lint:4,msg:2,loborti:[],ullamcorp:[],line:[4,1,8,3,7],"true":[4,2],congratul:0,info:3,strawberri:4,made:[2,7],possibl:[5,3,7],whether:6,type:6,tell:[2,7],asynchron:[1,3],record:4,below:7,limit:[1,7],suspendiss:[],rerun:3,otherwis:2,problem:3,similar:2,chip:1,facter:[1,2,3,7],curv:1,featur:[1,3],tasti:4,creat:1,certain:3,doesn:1,repres:4,ansil:[],deferenc:3,file:[0,1,2,3,4,5,7],mauri:[],exist:[1,3],check:[2,7],urna:[],nequ:[],again:3,googl:1,when:[2,3,7],nam:[],"default":[1,2,5],other:[1,2,3,7],futur:0,dignissim:[],test:[0,2],you:[0,1,3,4,5,7],node:[0,1],dapibu:[],journei:[],gravida:[],sequenc:1,asciidoc:0,releas:0,feli:[],aliquet:[],src:[2,3,7],lorem:[],"60k":1,dictumst:[],sphinx:0,rutrum:[],anywher:[],descript:[],portion:5,time:[0,1,2,3,5,7],push:3,serious:[],fermentum:[]},objtypes:{},titles:["Getting Started","Ansible","Ansible Modules","Playbooks: Ansible for Deployment, Configuration Management, and Orchestration","YAML Scripts","The Inventory File, Patterns, and Groups","API","Examples","Man Pages"],objnames:{},filenames:["gettingstarted","index","modules","playbooks","YAMLScripts","patterns","api","examples","man"]})
Playbooks are a completely different way to use ansible and are particularly awesome.
They are the basis for a really simple configuration management and deployment system, unlike any that already exist, and one that is very well suited to deploying complex multi-machine applications. While you might run the main ansible program for ad-hoc tasks, playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec.
Playbooks are a completely different way to use ansible and are particularly awesome. They are the basis for a really simple configuration management and deployment system, unlike any that already exist, and one that is very well suited to deploying complex multi-machine applications. While you might run the main ansible program for ad-hoc tasks, playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec.
Playbook Example
````````````````
Playbooks are expressed in YAML format and have a minimum of syntax. Each playbook is composed
of one or more patterns in a list. By composing a playbook of multiple patterns, it is possible
of one or more 'plays' in a list. By composing a playbook of multiple 'plays', it is possible
to orchestrate multi-machine deployments, running certain steps on all machines in
the webservers group, then certain steps on the database server group, then more commands
back on the webservers group, etc::
---
- hosts: all
- hosts: webservers
vars:
http_port: 80
max_clients: 200
...
...
@@ -45,38 +43,39 @@ back on the webservers group, etc::
Hosts line
``````````
The hosts line is alist of one or more groups or host patterns, seperated by colons.::
webservers:dbservers:*.foo.example.com
The hosts line is alist of one or more groups or host patterns, seperated by colons, as
described in the 'patterns' documentation.
Vars section
````````````
A list of variables that can be used in the 'action' lines of the template, or in
included templates. Variables are deferenced like this::
A list of variables that can be used in the templates, action lines, or included files.
Variables are deferenced using ``jinja2`` syntax like this::
{{ varname }}
These variables will be pushed down to the managed systems for use in templating operations.
These variables will be pushed down to the managed systems for use in templating operations, where
the way to dereference them in templates is exactly the same.
Further, if there are discovered variables about the system (say, if facter or ohai were
installed) these variables bubble up back into the playbook, and can be used on each
system just like explicitly set variables. Facter variables are prefixed with 'facter'
and Ohai variables are prefixed with 'ohai'.
system just like explicitly set variables. Facter variables are prefixed with 'facter_'
and Ohai variables are prefixed with 'ohai_'.
Tasks list
``````````
Tasks are executed in order, one at a time, against all machines matched by the host
pattern, before moving on to the next task. Failed tasks are taken out of the rotation.
Task name and comment
`````````
Each play contains a list of tasks. Tasks are executed in order, one at a time, against
all machines matched by the play's host pattern, before moving on to the next task.
Hosts with failed tasks are taken out of the rotation for the entire playbook. If things fail,
correct the problem and rerun. Modules other than command are idempotent, meaning if you
run them again, they will make the changes they are told to make to bring the system to
the desired state.
Each task has a name (required) and optional comment. This is for informational purposes only
Task name and action
`````````````````````
Task action
```````````
Every task must have a name, which is included in the output from running the playbook.
The action line is the name of an ansible module followed by parameters. Usually these
are expressed in key=value form, except for the command module, which looks just like a Linux/Unix