mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Add junos_system declartive module and other related change (#25859)
* Add junos_system declartive module and other related change * junos_system declartive module * integration test for junos_system * integration test for net_system (junos platform) * pep8 fixes for junos modules * move to lxml from elementree for xml parsing as it support complete set of xpath api's * other minor changes * Fix CI and doc changes * Fix unit test failures * Fix typo in import * Fix import issue for py2.6 * Add missed Element in import
This commit is contained in:
@@ -76,6 +76,11 @@ options:
|
||||
- State of the Interface configuration.
|
||||
default: present
|
||||
choices: ['present', 'absent', 'active', 'suspend']
|
||||
requirements:
|
||||
- ncclient (>=v0.5.2)
|
||||
notes:
|
||||
- This module requires the netconf system service be enabled on
|
||||
the remote device being managed
|
||||
"""
|
||||
|
||||
EXAMPLES = """
|
||||
@@ -136,12 +141,15 @@ rpc:
|
||||
"""
|
||||
import collections
|
||||
|
||||
from xml.etree.ElementTree import tostring
|
||||
|
||||
from ansible.module_utils.junos import junos_argument_spec, check_args
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.junos import load_config, map_params_to_obj, map_obj_to_ele
|
||||
|
||||
try:
|
||||
from lxml.etree import tostring
|
||||
except ImportError:
|
||||
from xml.etree.ElementTree import tostring
|
||||
|
||||
USE_PERSISTENT_CONNECTION = True
|
||||
|
||||
|
||||
@@ -193,7 +201,7 @@ def main():
|
||||
|
||||
param_to_xpath_map = collections.OrderedDict()
|
||||
param_to_xpath_map.update({
|
||||
'name': 'name',
|
||||
'name': {'xpath': 'name', 'is_key': True},
|
||||
'description': 'description',
|
||||
'speed': 'speed',
|
||||
'mtu': 'mtu',
|
||||
|
||||
Reference in New Issue
Block a user