Skip to content

Commit

Permalink
SSH resource module implementation (#462)
Browse files Browse the repository at this point in the history
* Implementation of SSH resource module.

* Code changes
1. Handling delete of SSH client algorithms (comma separated string)
when the algorithms remain same and the order of algorithms in input
configuration is different from that of existing.
2. Involving cleanup.

* Update plugins/module_utils/network/sonic/config/ssh/ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/module_utils/network/sonic/config/ssh/ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/module_utils/network/sonic/config/ssh/ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/module_utils/network/sonic/config/ssh/ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/module_utils/network/sonic/facts/ssh/ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/modules/sonic_ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/modules/sonic_ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/modules/sonic_ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/modules/sonic_ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/modules/sonic_ssh.py

Co-authored-by: Kerry Meyer <kerry.meyer@dell.com>

* Update plugins/modules/sonic_ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update plugins/modules/sonic_ssh.py

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update tests/regression/roles/sonic_ssh/defaults/main.yml

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Update tests/regression/roles/sonic_ssh/defaults/main.yml

Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>

* Incorporated code review comments.

* Incorporated code review comment.

---------

Co-authored-by: Balasubramaniam K1 <balasubramaniam.k1@sncinfra-maa-01.dng.delllabs.net>
Co-authored-by: stalabi1 <54641848+stalabi1@users.noreply.github.com>
Co-authored-by: Kerry Meyer <kerry.meyer@dell.com>
  • Loading branch information
4 people authored Nov 13, 2024
1 parent 43376fd commit e500d90
Show file tree
Hide file tree
Showing 16 changed files with 1,107 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugins/module_utils/network/sonic/argspec/facts/facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def __init__(self, **kwargs):
'login_lockout',
'poe',
'mgmt_servers',
'ospf_area'
'ospf_area',
'ssh',
]

argument_spec = {
Expand Down
65 changes: 65 additions & 0 deletions plugins/module_utils/network/sonic/argspec/ssh/ssh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# -*- coding: utf-8 -*-
# Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################

"""
The arg spec for the sonic_ssh module
"""

from __future__ import absolute_import, division, print_function
__metaclass__ = type


class SshArgs(object): # pylint: disable=R0903
"""The arg spec for the sonic_ssh module
"""

def __init__(self, **kwargs):
pass

argument_spec = {
'config': {
'options': {
'client': {
'options': {
'cipher': {
'type': 'str'
},
'kex': {
'type': 'str'
},
'mac': {
'type': 'str'
}
},
'type': 'dict'
}
},
'type': 'dict'
},
'state': {
'choices': ['merged', 'deleted', 'replaced', 'overridden'],
'default': 'merged',
'type': 'str'
}
} # pylint: disable=C0301
Loading

0 comments on commit e500d90

Please sign in to comment.