mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
now correctly picks up old become password host vars
This commit is contained in:
parent
d74cf46778
commit
a6aedbcc51
3 changed files with 11 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue