mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Fix non-sudo execution, add --sudo-user to ansible-playbook.
This commit is contained in:
parent
dcbe48e2d4
commit
710d085def
4 changed files with 13 additions and 8 deletions
|
@ -309,6 +309,8 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False, asyn
|
|||
if runas_opts:
|
||||
parser.add_option("-s", "--sudo", default=False, action="store_true",
|
||||
dest='sudo', help="run operations with sudo (nopasswd)")
|
||||
parser.add_option('-U', '--sudo-user', dest='sudo_user', help='desired sudo user (default=root)',
|
||||
default=None) # Can't default to root because we need to detect when this option was given
|
||||
parser.add_option('-u', '--user', default=constants.DEFAULT_REMOTE_USER,
|
||||
dest='remote_user',
|
||||
help='connect as this user (default=%s)' % constants.DEFAULT_REMOTE_USER)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue