diff --git a/.gitignore b/.gitignore index aa861ed..f1012bf 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,5 @@ docs/_build/ .idea .DS_Store + +env diff --git a/ansible/napalm_get_facts b/ansible/napalm_get_facts new file mode 100644 index 0000000..3f5933b --- /dev/null +++ b/ansible/napalm_get_facts @@ -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() diff --git a/napalm/fortios.py b/napalm/fortios.py index e153b97..f0945e4 100644 --- a/napalm/fortios.py +++ b/napalm/fortios.py @@ -209,4 +209,4 @@ class FortiOSDriver(NetworkDriver): # } def get_lldp_neighbors(self): - return {} \ No newline at end of file + return {} diff --git a/utils/junos_views.yml b/utils/junos_views.yml index 4477a9d..e3f3be5 100644 --- a/utils/junos_views.yml +++ b/utils/junos_views.yml @@ -1,7 +1,7 @@ --- #### -#### Interface table +#### Interface table #### junos_iface_table: @@ -18,7 +18,7 @@ junos_iface_view: is_enabled: { admin-status: True=up } description: description last_flapped: { interface-flapped/@seconds: int } - mode: logical-interface/address-family/address-family-name + #mode: logical-interface/address-family/address-family-name speed: speed mac_address: current-physical-address @@ -27,7 +27,7 @@ junos_iface_view: #### junos_route_instance_table: - rpc: get-instance-information + rpc: get-instance-information item: instance-core key: instance-name view: junos_route_instance_view @@ -54,7 +54,7 @@ junos_bgp_view: sent_prefixes: { bgp-rib/aadvertised-prefix-count: int } #### -#### LLDP table +#### LLDP table #### junos_lldp_table: @@ -67,5 +67,3 @@ junos_lldp_view: fields: hostname: lldp-remote-system-name port: lldp-remote-port-description | lldp-remote-port-id - -