diff options
author | Matt Martz <matt@sivel.net> | 2014-06-03 16:34:42 +0200 |
---|---|---|
committer | Matt Martz <matt@sivel.net> | 2014-06-24 22:02:24 +0200 |
commit | 19f5ce2c9c86d665466f4f82668de8e769d63aa1 (patch) | |
tree | b7d4c856cab48025ce836dcf60af49c6350ec948 /bin/ansible-playbook | |
parent | Check to make sure key exists in tag list before using it (diff) | |
download | ansible-19f5ce2c9c86d665466f4f82668de8e769d63aa1.tar.xz ansible-19f5ce2c9c86d665466f4f82668de8e769d63aa1.zip |
Allow --vault-password-file to work with a script as well as a flat file
Diffstat (limited to 'bin/ansible-playbook')
-rwxr-xr-x | bin/ansible-playbook | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/bin/ansible-playbook b/bin/ansible-playbook index d7c9182e2f..00a3b3d63c 100755 --- a/bin/ansible-playbook +++ b/bin/ansible-playbook @@ -125,17 +125,9 @@ def main(args): options.sudo_user = options.sudo_user or C.DEFAULT_SUDO_USER options.su_user = options.su_user or C.DEFAULT_SU_USER - if options.vault_password_file: - this_path = os.path.expanduser(options.vault_password_file) - try: - f = open(this_path, "rb") - tmp_vault_pass=f.read().strip() - f.close() - except (OSError, IOError), e: - raise errors.AnsibleError("Could not read %s: %s" % (this_path, e)) - - if not options.ask_vault_pass: - vault_pass = tmp_vault_pass + # read vault_pass from a file + if not options.ask_vault_pass and options.vault_password_file: + vault_pass = utils.read_vault_file(options.vault_password_file) extra_vars = {} for extra_vars_opt in options.extra_vars: |