diff --git a/lib/ansible/modules/network/eos/eos_banner.py b/lib/ansible/modules/network/eos/eos_banner.py index 89e7507d9a..0fbaa393af 100644 --- a/lib/ansible/modules/network/eos/eos_banner.py +++ b/lib/ansible/modules/network/eos/eos_banner.py @@ -130,9 +130,7 @@ def map_config_to_obj(module): output = run_commands(module, ['show banner %s' % module.params['banner']]) obj = {'banner': module.params['banner'], 'state': 'absent'} if output: - if module.params['transport'] == 'cli': - obj['text'] = output[0] - else: + if module.params['transport'] == 'eapi': # On EAPI we need to extract the banner text from dict key # 'loginBanner' if module.params['banner'] == 'login': @@ -141,6 +139,8 @@ def map_config_to_obj(module): banner_response_key = 'motd' if isinstance(output[0], dict) and banner_response_key in output[0].keys(): obj['text'] = output[0] + else: + obj['text'] = output[0] obj['state'] = 'present' return obj diff --git a/lib/ansible/plugins/action/net_base.py b/lib/ansible/plugins/action/net_base.py index 3923ddafec..22ccf4bc82 100644 --- a/lib/ansible/plugins/action/net_base.py +++ b/lib/ansible/plugins/action/net_base.py @@ -70,6 +70,7 @@ class ActionModule(ActionBase): if 'authorize' in self.provider.keys(): play_context.become = self.provider['authorize'] or False play_context.become_pass = self.provider['auth_pass'] + play_context.become_method = 'enable' if self._play_context.connection == 'local': socket_path = self._start_connection(play_context)