summaryrefslogtreecommitdiffstats
path: root/bin/ansible-playbook
diff options
context:
space:
mode:
authorJosh Drake <joshua.c.drake@gmail.com>2014-07-03 21:02:26 +0200
committerMichael DeHaan <michael@ansible.com>2014-08-11 18:23:05 +0200
commit917e868f6589abe92cc336f45d33f7a029c8f46b (patch)
tree1aba6c9263723bbf9ed460564b445517cf4934ad /bin/ansible-playbook
parentWIP on the re-implementation of fact caching and various backends. (diff)
downloadansible-917e868f6589abe92cc336f45d33f7a029c8f46b.tar.xz
ansible-917e868f6589abe92cc336f45d33f7a029c8f46b.zip
Implement fact cache flushing alongside a command-line argument to invoke it.
Diffstat (limited to 'bin/ansible-playbook')
-rwxr-xr-xbin/ansible-playbook7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/ansible-playbook b/bin/ansible-playbook
index 3d05d8e29c..3a5e399b23 100755
--- a/bin/ansible-playbook
+++ b/bin/ansible-playbook
@@ -83,6 +83,8 @@ def main(args):
help="start the playbook at the task matching this name")
parser.add_option('--force-handlers', dest='force_handlers', action='store_true',
help="run handlers even if a task fails")
+ parser.add_option('--flush-cache', dest='flush_cache', action='store_true',
+ help="flush to fact cache")
options, args = parser.parse_args(args)
@@ -191,6 +193,10 @@ def main(args):
force_handlers=options.force_handlers
)
+ if options.flush_cache:
+ display(callbacks.banner("FLUSHING FACT CACHE"))
+ pb.SETUP_CACHE.flush()
+
if options.listhosts or options.listtasks or options.syntax:
print ''
print 'playbook: %s' % playbook
@@ -313,4 +319,3 @@ if __name__ == "__main__":
except KeyboardInterrupt, ke:
display("ERROR: interrupted", color='red', stderr=True)
sys.exit(1)
-