mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-12 03:41:02 +00:00
now correctly picks up old become password host vars
This commit is contained in:
@@ -165,8 +165,10 @@ class ConnectionInformation:
|
||||
# backwards compat
|
||||
self.sudo_exe = None
|
||||
self.sudo_flags = None
|
||||
self.sudo_pass = None
|
||||
self.su_exe = None
|
||||
self.su_flags = None
|
||||
self.su_pass = None
|
||||
|
||||
# general flags (should we move out?)
|
||||
self.verbosity = 0
|
||||
@@ -295,6 +297,13 @@ class ConnectionInformation:
|
||||
if variable_name in variables:
|
||||
setattr(new_info, attr, variables[variable_name])
|
||||
|
||||
# become legacy updates
|
||||
if not new_info.become_pass:
|
||||
if new_info.become_method == 'sudo' and new_info.sudo_pass:
|
||||
setattr(new_info, 'become_pass', new_info.sudo_pass)
|
||||
elif new_info.become_method == 'su' and new_info.su_pass:
|
||||
setattr(new_info, 'become_pass', new_info.su_pass)
|
||||
|
||||
return new_info
|
||||
|
||||
def make_become_cmd(self, cmd, executable=C.DEFAULT_EXECUTABLE):
|
||||
|
||||
Submodule lib/ansible/modules/core updated: abdd96ed1e...ff69ce7912
Submodule lib/ansible/modules/extras updated: 195ef57bfb...4e48ef9eca
Reference in New Issue
Block a user