Pass extra vars via file rather than via commandline, including custom creds.

The extra vars file created lives in the playbook private runtime
directory, and will be reaped along with the rest of the directory.

Adjust assorted unit tests as necessary.
This commit is contained in:
Bill Nottingham
2018-02-02 23:30:51 -05:00
committed by Ryan Petrello
parent 476dbe58c5
commit aa5bd9f5bf
5 changed files with 116 additions and 62 deletions

View File

@@ -803,6 +803,8 @@ def wrap_args_with_proot(args, cwd, **kwargs):
if not os.path.exists(path):
continue
path = os.path.realpath(path)
if os.path.isdir(path):
path = os.path.join(path, '') # add a trailing slash
new_args.extend(['--bind', '%s' % (path,), '%s' % (path,)])
if kwargs.get('isolated'):
if 'ansible-playbook' in args: