From 519c6ac8eeeed9d2438c1cc705fbf49f0ad75fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Mon, 22 Jun 2015 17:16:07 +0200 Subject: Add a --profile option to spot which task takes more time --- bin/cluster | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bin') diff --git a/bin/cluster b/bin/cluster index 2ea389523..954322482 100755 --- a/bin/cluster +++ b/bin/cluster @@ -178,6 +178,9 @@ class Cluster(object): verbose, inventory, ansible_env, playbook ) + if args.profile: + command = 'ANSIBLE_CALLBACK_PLUGINS=ansible-profile/callback_plugins ' + command + if args.verbose > 1: command = 'time {}'.format(command) @@ -234,6 +237,9 @@ if __name__ == '__main__': meta_parser.add_argument('-o', '--option', action='append', help='options') + meta_parser.add_argument('-p', '--profile', action='store_true', + help='Enable playbook profiling') + action_parser = parser.add_subparsers(dest='action', title='actions', description='Choose from valid actions') -- cgit v1.2.1