1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

When sudo'ing to root, keep the setup file location as /etc/ansible/setup

This commit is contained in:
Michael DeHaan 2012-07-07 09:29:03 -04:00
parent c592fdf838
commit 0d28466b22

View file

@ -263,16 +263,16 @@ class Runner(object):
if type(args) == dict:
is_dict = True
# TODO: keep this as a dict through the whole path to simplify this code
# TODO: make a _metadata_path function
if not is_dict:
if args.find("metadata=") == -1:
if self.remote_user == 'root':
if self.remote_user == 'root' or (self.sudo and self.sudo_user == 'root'):
args = "%s metadata=/etc/ansible/setup" % args
else:
args = "%s metadata=%s/setup" % (args, C.DEFAULT_REMOTE_TMP)
else:
if not 'metadata' in args:
if self.remote_user == 'root':
if self.remote_user == 'root' or (self.sudo and self.sudo_user == 'root'):
args['metadata'] = '/etc/ansible/setup'
else:
args['metadata'] = "%s/setup" % C.DEFAULT_REMOTE_TMP