|  | 
| 122 | 122 | 
 | 
| 123 | 123 | # Constants | 
| 124 | 124 | # Minimum PyEZ version required by shared code. | 
| 125 |  | -MIN_PYEZ_VERSION = "2.1.7" | 
|  | 125 | +MIN_PYEZ_VERSION = "2.2.0" | 
| 126 | 126 | # Installation URL for PyEZ. | 
| 127 | 127 | PYEZ_INSTALLATION_URL = "https://github.com/Juniper/py-junos-eznc#installation" | 
| 128 | 128 | # Minimum lxml version required by shared code. | 
| @@ -332,6 +332,24 @@ class ModuleDocFragment(object): | 
| 332 | 332 |         type: str | 
| 333 | 333 |         aliases: | 
| 334 | 334 |           - username | 
|  | 335 | +    cs_user: | 
|  | 336 | +        description: | 
|  | 337 | +          - The username used to authenticate with the console server over SSH.  | 
|  | 338 | +            This option is only required if you want to connect to a device over console | 
|  | 339 | +             using SSH as transport. Mutually exclusive with the I(console) option. | 
|  | 340 | +        required: false | 
|  | 341 | +        type: str | 
|  | 342 | +        aliases: | 
|  | 343 | +          - console_username | 
|  | 344 | +    cs_passwd: | 
|  | 345 | +        description: | 
|  | 346 | +          - The password used to authenticate with the console server over SSH.  | 
|  | 347 | +            This option is only required if you want to connect to a device over console | 
|  | 348 | +             using SSH as transport. Mutually exclusive with the I(console) option. | 
|  | 349 | +        required: false | 
|  | 350 | +        type: str | 
|  | 351 | +        aliases: | 
|  | 352 | +          - console_password | 
| 335 | 353 | ''' | 
| 336 | 354 | 
 | 
| 337 | 355 |     LOGGING_DOCUMENTATION = ''' | 
| @@ -475,6 +493,15 @@ class ModuleDocFragment(object): | 
| 475 | 493 |                    # Default behavior coded in JuniperJunosActionModule.run() | 
| 476 | 494 |                    default=None, | 
| 477 | 495 |                    no_log=True), | 
|  | 496 | +    'cs_user': dict(type='str', | 
|  | 497 | +                 aliases=['console_username'], | 
|  | 498 | +                 required=False, | 
|  | 499 | +                 default=None), | 
|  | 500 | +    'cs_passwd': dict(type='str', | 
|  | 501 | +                   aliases=['console_password'], | 
|  | 502 | +                   required=False, | 
|  | 503 | +                   default=None, | 
|  | 504 | +                   no_log=True), | 
| 478 | 505 |     'ssh_private_key_file': dict(type='path', | 
| 479 | 506 |                                  required=False, | 
| 480 | 507 |                                  aliases=['ssh_keyfile'], | 
| @@ -513,7 +540,9 @@ class ModuleDocFragment(object): | 
| 513 | 540 | connection_spec_mutually_exclusive = [['mode', 'console'], | 
| 514 | 541 |                                       ['port', 'console'], | 
| 515 | 542 |                                       ['baud', 'console'], | 
| 516 |  | -                                      ['attempts','console']] | 
|  | 543 | +                                      ['attempts','console'], | 
|  | 544 | +                                      ['cs_user', 'console'], | 
|  | 545 | +                                      ['cs_passwd', 'console']] | 
| 517 | 546 | # Keys are connection options. Values are a list of task_vars to use as the | 
| 518 | 547 | # default value. Order of values specified against each key represents the | 
| 519 | 548 | # preference order of options in the key. Has to be maintained consistent with | 
| @@ -1308,6 +1337,9 @@ def open(self): | 
| 1308 | 1337 |             self.close() | 
| 1309 | 1338 |             log_connect_args = dict(connect_args) | 
| 1310 | 1339 |             log_connect_args['passwd'] = 'NOT_LOGGING_PARAMETER' | 
|  | 1340 | +            if 'cs_passwd' in log_connect_args:  | 
|  | 1341 | +                log_connect_args['cs_passwd'] = 'NOT_LOGGING_PARAMETER' | 
|  | 1342 | +                 | 
| 1311 | 1343 |             self.logger.debug("Creating device parameters: %s", | 
| 1312 | 1344 |                               log_connect_args) | 
| 1313 | 1345 |             timeout = connect_args.pop('timeout') | 
|  | 
0 commit comments