Add --vault-password-file to bin/ansible-pull

This commit is contained in:
James Tanner 2014-02-26 14:52:57 -05:00
parent d6b912c429
commit b74105c689

View file

@ -46,6 +46,7 @@ import datetime
import socket
from ansible import utils
from ansible.utils import cmd_functions
from ansible import errors
DEFAULT_REPO_TYPE = 'git'
DEFAULT_PLAYBOOK = 'local.yml'
@ -123,6 +124,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('--vault-password-file', dest='vault_password_file',
help="vault password file")
options, args = parser.parse_args(args)
hostname = socket.getfqdn()
@ -178,6 +181,9 @@ def main(args):
return 1
cmd = 'ansible-playbook %s %s' % (base_opts, playbook)
import epdb; epdb.st()
if options.vault_password_file:
cmd += " --vault-password-file=%s" % options.vault_password_file
if options.inventory:
cmd += ' -i "%s"' % options.inventory
os.chdir(options.dest)