mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07: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:
parent
4847613725
commit
85219dfdf3
4 changed files with 73 additions and 10 deletions
|
@ -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']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue