mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Add support to fetch old style junos facts (#25250)
* Add support to fetch old style junos facts Fixes #25050 Add support to fetch old style facts supported in Ansible <= 2.2 To fetch old style facts value `gather_subset` value shoule be `all` and `junos-eznc` is required to be installed on control node as a prerequisite. * Remove unwanted import
This commit is contained in:
@@ -99,7 +99,7 @@ EXAMPLES = """
|
||||
"""
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils.junos import junos_argument_spec
|
||||
from ansible.module_utils.junos import junos_argument_spec, get_param
|
||||
|
||||
try:
|
||||
from jnpr.junos import Device
|
||||
@@ -110,8 +110,6 @@ except ImportError:
|
||||
HAS_PYEZ = False
|
||||
|
||||
|
||||
get_param = lambda x, y: x.params[y] or x.params['provider'].get(y)
|
||||
|
||||
def connect(module):
|
||||
host = get_param(module, 'host')
|
||||
|
||||
@@ -138,6 +136,7 @@ def connect(module):
|
||||
|
||||
return device
|
||||
|
||||
|
||||
def install_package(module, device):
|
||||
junos = SW(device)
|
||||
package = module.params['src']
|
||||
|
||||
Reference in New Issue
Block a user