commit
82793b1380
3 files changed
+69
-3
No files matched your search
@@ -54,3 +54,5 @@ docs/_build/
|
|||||||
|
|
||||||
.idea
|
.idea
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
env
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright 2014 Spotify AB. All rights reserved.
|
||||||
|
#
|
||||||
|
# The contents of this file are licensed under the Apache License, Version 2.0
|
||||||
|
# (the "License"); you may not use this file except in compliance with the
|
||||||
|
# License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations under
|
||||||
|
# the License.
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
|
||||||
|
import ast
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger('eos_install_config')
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
module = AnsibleModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
hostname=dict(required=True),
|
||||||
|
username=dict(required=True),
|
||||||
|
password=dict(required=True),
|
||||||
|
dev_os=dict(required=True),
|
||||||
|
),
|
||||||
|
supports_check_mode=True
|
||||||
|
)
|
||||||
|
|
||||||
|
hostname = module.params['hostname']
|
||||||
|
username = module.params['username']
|
||||||
|
dev_os = module.params['dev_os']
|
||||||
|
password = module.params['password']
|
||||||
|
|
||||||
|
|
||||||
|
network_driver = get_network_driver(dev_os)
|
||||||
|
|
||||||
|
device = network_driver(hostname, username, password)
|
||||||
|
device.open()
|
||||||
|
|
||||||
|
facts = device.get_facts()
|
||||||
|
facts['interface_details'] = device.get_interfaces()
|
||||||
|
|
||||||
|
device.close()
|
||||||
|
|
||||||
|
module.exit_json(ansible_facts=facts)
|
||||||
|
|
||||||
|
from ansible.module_utils.basic import *
|
||||||
|
from napalm import get_network_driver
|
||||||
|
|
||||||
|
main()
|
||||||
@@ -18,7 +18,7 @@ junos_iface_view:
|
|||||||
is_enabled: { admin-status: True=up }
|
is_enabled: { admin-status: True=up }
|
||||||
description: description
|
description: description
|
||||||
last_flapped: { interface-flapped/@seconds: int }
|
last_flapped: { interface-flapped/@seconds: int }
|
||||||
mode: logical-interface/address-family/address-family-name
|
#mode: logical-interface/address-family/address-family-name
|
||||||
speed: speed
|
speed: speed
|
||||||
mac_address: current-physical-address
|
mac_address: current-physical-address
|
||||||
|
|
||||||
@@ -67,5 +67,3 @@ junos_lldp_view:
|
|||||||
fields:
|
fields:
|
||||||
hostname: lldp-remote-system-name
|
hostname: lldp-remote-system-name
|
||||||
port: lldp-remote-port-description | lldp-remote-port-id
|
port: lldp-remote-port-description | lldp-remote-port-id
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user