From c9b0026cd0ad423212d3637efacee5f3879f4609 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Thu, 20 Apr 2017 15:58:45 -0400 Subject: [PATCH] Eos port default values (#23829) * Hook port back up for eos cli transport * The default values have moved * Why not have conditional defaults? --- lib/ansible/plugins/action/eos.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ansible/plugins/action/eos.py b/lib/ansible/plugins/action/eos.py index 9d3a18b541..99ac6b9438 100644 --- a/lib/ansible/plugins/action/eos.py +++ b/lib/ansible/plugins/action/eos.py @@ -57,6 +57,7 @@ class ActionModule(_ActionModule): pc.connection = 'network_cli' pc.network_os = 'eos' pc.remote_addr = provider['host'] or self._play_context.remote_addr + pc.port = provider['port'] or self._play_context.port or 22 pc.remote_user = provider['username'] or self._play_context.connection_user pc.password = provider['password'] or self._play_context.password pc.private_key_file = provider['ssh_keyfile'] or self._play_context.private_key_file @@ -95,8 +96,12 @@ class ActionModule(_ActionModule): if provider.get('host') is None: provider['host'] = self._play_context.remote_addr + if provider.get('use_ssl') is None: + provider['use_ssl'] = eos_argument_spec['use_ssl']['default'] + if provider.get('port') is None: - provider['port'] = eos_argument_spec['port']['default'] + default_port = 443 if provider['use_ssl'] else 80 + provider['port'] = self._play_context.port or default_port if provider.get('timeout') is None: provider['timeout'] = self._play_context.timeout @@ -110,9 +115,6 @@ class ActionModule(_ActionModule): if provider.get('authorize') is None: provider['authorize'] = False - if provider.get('use_ssl') is None: - provider['use_ssl'] = eos_argument_spec['use_ssl']['default'] - if provider.get('validate_certs') is None: provider['validate_certs'] = eos_argument_spec['validate_certs']['default']