@ -60,6 +60,8 @@ class ActionModule(_ActionModule):
pc . private_key_file = provider [ ' ssh_keyfile ' ] or self . _play_context . private_key_file
pc . private_key_file = provider [ ' ssh_keyfile ' ] or self . _play_context . private_key_file
pc . timeout = int ( provider [ ' timeout ' ] or C . PERSISTENT_COMMAND_TIMEOUT )
pc . timeout = int ( provider [ ' timeout ' ] or C . PERSISTENT_COMMAND_TIMEOUT )
pc . become = provider [ ' authorize ' ] or False
pc . become = provider [ ' authorize ' ] or False
if pc . become :
pc . become_method = ' enable '
pc . become_pass = provider [ ' auth_pass ' ]
pc . become_pass = provider [ ' auth_pass ' ]
display . vvv ( ' using connection plugin %s ' % pc . connection , pc . remote_addr )
display . vvv ( ' using connection plugin %s ' % pc . connection , pc . remote_addr )
@ -78,8 +80,8 @@ class ActionModule(_ActionModule):
conn = Connection ( socket_path )
conn = Connection ( socket_path )
out = conn . get_prompt ( )
out = conn . get_prompt ( )
if to_text ( out , errors = ' surrogate_then_replace ' ) . strip ( ) . endswith ( ' )# ' ) :
if to_text ( out , errors = ' surrogate_then_replace ' ) . strip ( ) . endswith ( ' )# ' ) :
display . vvvv ( ' wrong context, sending e xit to device' , self . _play_context . remote_addr )
display . vvvv ( ' wrong context, sending e nd to device' , self . _play_context . remote_addr )
conn . send_command ( ' e xit ' )
conn . send_command ( ' e nd ' )
task_vars [ ' ansible_socket ' ] = socket_path
task_vars [ ' ansible_socket ' ] = socket_path