ansible-pull support for -e (--extra-vars) option (same as ansible-playbook) #5707

pull/5890/head
Ingmar Hupp 11 years ago
parent 77d5a18392
commit 1f0cdc5ec8

@ -116,6 +116,8 @@ def main(args):
'Defaults to behavior of repository module.') 'Defaults to behavior of repository module.')
parser.add_option('-i', '--inventory-file', dest='inventory', parser.add_option('-i', '--inventory-file', dest='inventory',
help="location of the inventory host file") help="location of the inventory host file")
parser.add_option('-e', '--extra-vars', dest="extra_vars", action="append",
help="set additional variables as key=value or YAML/JSON", default=[])
parser.add_option('-v', '--verbose', default=False, action="callback", parser.add_option('-v', '--verbose', default=False, action="callback",
callback=increment_debug, callback=increment_debug,
help='Pass -vvvv to ansible-playbook') help='Pass -vvvv to ansible-playbook')
@ -180,6 +182,8 @@ def main(args):
cmd = 'ansible-playbook %s %s' % (base_opts, playbook) cmd = 'ansible-playbook %s %s' % (base_opts, playbook)
if options.inventory: if options.inventory:
cmd += ' -i "%s"' % options.inventory cmd += ' -i "%s"' % options.inventory
for ev in options.extra_vars:
cmd += ' -e "%s"' % ev
os.chdir(options.dest) os.chdir(options.dest)
# RUN THE PLAYBOOK COMMAND # RUN THE PLAYBOOK COMMAND

Loading…
Cancel
Save