Skip to content

Commit

Permalink
adding -K flag for ask-sudo-pass to ansible-pull
Browse files Browse the repository at this point in the history
  • Loading branch information
stevetjoa committed Feb 3, 2014
1 parent 2d0e9cd commit 335bc1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/ansible-pull
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 335bc1e

Please sign in to comment.