@@ -302,7 +302,7 @@ def _connect_su(spec):
302302 """
303303 Return ContextService arguments for su as a become method.
304304 """
305- return {
305+ args = {
306306 'method' : 'su' ,
307307 'enable_lru' : True ,
308308 'kwargs' : {
@@ -314,13 +314,15 @@ def _connect_su(spec):
314314 'remote_name' : get_remote_name (spec ),
315315 }
316316 }
317+ LOG .info ('_connect_su: %r' , args )
318+ return args
317319
318320
319321def _connect_sudo (spec ):
320322 """
321323 Return ContextService arguments for sudo as a become method.
322324 """
323- return {
325+ args = {
324326 'method' : 'sudo' ,
325327 'enable_lru' : True ,
326328 'kwargs' : {
@@ -333,6 +335,8 @@ def _connect_sudo(spec):
333335 'remote_name' : get_remote_name (spec ),
334336 }
335337 }
338+ LOG .info ('_connect_sudo: %r' , args )
339+ return args
336340
337341
338342def _connect_doas (spec ):
@@ -357,7 +361,7 @@ def _connect_mitogen_su(spec):
357361 """
358362 Return ContextService arguments for su as a first class connection.
359363 """
360- return {
364+ args = {
361365 'method' : 'su' ,
362366 'kwargs' : {
363367 'username' : spec .remote_user (),
@@ -368,13 +372,15 @@ def _connect_mitogen_su(spec):
368372 'remote_name' : get_remote_name (spec ),
369373 }
370374 }
375+ LOG .info ('_connect_mitogen_su: %r' , args )
376+ return args
371377
372378
373379def _connect_mitogen_sudo (spec ):
374380 """
375381 Return ContextService arguments for sudo as a first class connection.
376382 """
377- return {
383+ args = {
378384 'method' : 'sudo' ,
379385 'kwargs' : {
380386 'username' : spec .remote_user (),
@@ -386,6 +392,8 @@ def _connect_mitogen_sudo(spec):
386392 'remote_name' : get_remote_name (spec ),
387393 }
388394 }
395+ LOG .info ('_connect_mitogen_sudo: %r' , args )
396+ return args
389397
390398
391399def _connect_mitogen_doas (spec ):
@@ -491,6 +499,7 @@ class Connection(ansible.plugins.connection.ConnectionBase):
491499 #: Only sudo, su, and doas are supported for now.
492500 # Ansible ConnectionBase attribute, removed in Ansible >= 2.8
493501 become_methods = ['sudo' , 'su' , 'doas' ]
502+ become_methods += ['mitogen.builtin.%s' % s for s in become_methods ]
494503
495504 #: Dict containing init_child() return value as recorded at startup by
496505 #: ContextService. Contains:
0 commit comments