From 335bc1ee5ca876d2d51f1cfe676013e3fc1d7eea Mon Sep 17 00:00:00 2001 From: Steve Tjoa Date: Mon, 3 Feb 2014 12:20:04 -0800 Subject: [PATCH] adding -K flag for ask-sudo-pass to ansible-pull --- bin/ansible-pull | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/ansible-pull b/bin/ansible-pull index 3253ced80c..abb0b99868 100755 --- a/bin/ansible-pull +++ b/bin/ansible-pull @@ -123,6 +123,8 @@ def main(args): default=DEFAULT_REPO_TYPE, help='Module name used to check out repository. ' 'Default is %s.' % DEFAULT_REPO_TYPE) + parser.add_option('-K', '--ask-sudo-pass', default=False, dest='ask_sudo_pass', action='store_true', + help='ask for sudo password') options, args = parser.parse_args(args) hostname = socket.getfqdn() @@ -180,6 +182,8 @@ def main(args): cmd = 'ansible-playbook %s %s' % (base_opts, playbook) if options.inventory: cmd += ' -i "%s"' % options.inventory + if options.ask_sudo_pass: + cmd += ' -K' os.chdir(options.dest) # RUN THE PLAYBOOK COMMAND