Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
cf3c7766
Commit
cf3c7766
authored
Apr 20, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document the new handler flushing system.
parent
32fb6c80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
docsite/latest/rst/playbooks.rst
+19
-3
No files found.
docsite/latest/rst/playbooks.rst
View file @
cf3c7766
...
@@ -269,9 +269,12 @@ As we've mentioned, modules are written to be 'idempotent' and can relay when
...
@@ -269,9 +269,12 @@ As we've mentioned, modules are written to be 'idempotent' and can relay when
they have made a change on the remote system. Playbooks recognize this and
they have made a change on the remote system. Playbooks recognize this and
have a basic event system that can be used to respond to change.
have a basic event system that can be used to respond to change.
These '
notify
' actions are triggered at the end of each '
play
' in a playbook, and
These '
notify
' actions are triggered at the end of each block of tasks in a playbook, and will only be
trigger only once each. For instance, multiple resources may indicate
triggered once even if notified by multiple different tasks.
that apache needs to be restarted, but apache will only be bounced once.
For instance, multiple resources may indicate
that apache needs to be restarted because they have changed a config file,
but apache will only be bounced once to avoid unneccessary restarts.
Here'
s
an
example
of
restarting
two
services
when
the
contents
of
a
file
Here'
s
an
example
of
restarting
two
services
when
the
contents
of
a
file
change
,
but
only
if
the
file
changes
::
change
,
but
only
if
the
file
changes
::
...
@@ -305,6 +308,19 @@ won't need them for much else.
...
@@ -305,6 +308,19 @@ won't need them for much else.
..
note
::
..
note
::
Notify
handlers
are
always
run
in
the
order
written
.
Notify
handlers
are
always
run
in
the
order
written
.
Roles
are
described
later
on
.
It
's worth while to point out that handlers are
automatically processed between '
pre_tasks
', '
roles
', '
tasks
', and '
post_tasks
'
sections. If you ever want to flush all the handler commands immediately though,
in 1.2 and later, you can::
tasks:
- shell: some tasks go here
- meta: flush_handlers
- shell: some other tasks
In the above example any queued up handlers would be processed early when the '
meta
'
statement was reached. This is a bit of a niche case but can come in handy from
time to time.
Task Include Files And Encouraging Reuse
Task Include Files And Encouraging Reuse
````````````````````````````````````````
````````````````````````````````````````
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment