|
|
|
@ -79,7 +79,6 @@ try:
|
|
|
|
|
except ImportError:
|
|
|
|
|
from ansible.vars.unsafe_proxy import AnsibleUnsafeText
|
|
|
|
|
|
|
|
|
|
import ansible_mitogen.loaders
|
|
|
|
|
import mitogen.core
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -436,9 +435,18 @@ class PlayContextSpec(Spec):
|
|
|
|
|
return self._play_context.become_user
|
|
|
|
|
|
|
|
|
|
def become_pass(self):
|
|
|
|
|
become_method = self.become_method()
|
|
|
|
|
become_plugin = ansible_mitogen.loaders.become_loader.get(become_method)
|
|
|
|
|
become_pass = become_plugin.get_option('become_pass', hostvars=self._task_vars)
|
|
|
|
|
# become_pass is owned/provided by the active become plugin. However
|
|
|
|
|
# PlayContext is intertwined with it. Known complications
|
|
|
|
|
# - ansible_become_password is higher priority than ansible_become_pass,
|
|
|
|
|
# `play_context.become_pass` doesn't obey this (atleast with Mitgeon).
|
|
|
|
|
# - `meta: reset_connection` runs `connection.reset()` but
|
|
|
|
|
# `ansible_mitogen.connection.Connection.reset()` recreates the
|
|
|
|
|
# connection object, setting `connection.become = None`.
|
|
|
|
|
become_plugin = self._connection.become
|
|
|
|
|
try:
|
|
|
|
|
become_pass = become_plugin.get_option('become_pass', playcontext=self._play_context)
|
|
|
|
|
except AttributeError:
|
|
|
|
|
become_pass = self._play_context.become_pass
|
|
|
|
|
return optional_secret(become_pass)
|
|
|
|
|
|
|
|
|
|
def password(self):
|
|
|
|
|