mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Add support for become_flags on the task level (#17310)
Working on the test suite, I tried to replace a call to sudo to a call to su, and found out that I can't change user to 'nobody' without changing the option become_flags in ansible.cfg As this would be dependent on the user and the task, it make more sense to push the setting there.
This commit is contained in:
committed by
Toshio Kuratomi
parent
65f1eb8e5c
commit
e3f54cb798
@@ -35,6 +35,7 @@ class Become:
|
||||
_become = FieldAttribute(isa='bool')
|
||||
_become_method = FieldAttribute(isa='string')
|
||||
_become_user = FieldAttribute(isa='string')
|
||||
_become_flags = FieldAttribute(isa='string')
|
||||
|
||||
def __init__(self):
|
||||
return super(Become, self).__init__()
|
||||
|
||||
@@ -122,6 +122,7 @@ TASK_ATTRIBUTE_OVERRIDES = (
|
||||
'become_user',
|
||||
'become_pass',
|
||||
'become_method',
|
||||
'become_flags',
|
||||
'connection',
|
||||
'docker_extra_args',
|
||||
'delegate_to',
|
||||
|
||||
Reference in New Issue
Block a user