Git Product home page Git Product logo

ntc-ansible's Introduction

Build Status

Ansible Modules for Network Automation

And even get structured data back from CLI devices!


Requirements

  • netmiko
  • TestFSM
  • terminal

Modules


ntc_show_command

Gets config data from devices that don't have an API

Synopsis

This module offers structured data for CLI enabled devices by using the TextFSM library for templating and netmiko for SSH connectivity.

platform Naming Convention

The platform parameter given to the modules should be of the form:<netmiko_device_type>[-<hardware_type>]. In plain English, that means it should start with a supported netmiko device type, followed by an optional hyphen and arbitrary hardware specific identifier.

Valid platform names:

cisco_ios-c3k
cisco_ios-c6k
cisco_ios
cisco_nxos
hp_comware

Invalid platform names:

cisco-ios-c3k
csco_ios
hp-comware_5900

Options

Parameter required default choices comments
username no
    Username used to login to the target device
    platform yes ssh
      Platform FROM the index file
      template_dir no ntc_templates
        path where TextFSM templates are stored. Default path is ntc with ntc in the same working dir as the playbook being run
        host no
          IP Address or hostname (resolvable by Ansible control host)
          connection no ssh
          • ssh
          • offline
          connect to device using netmiko or read from offline file for testing
          command yes
            Command to execute on target device
            file no
              If using connection=offline, this is the file (with path) of a file that contains raw text output, i.e. 'show command' and then the contents of the file will be rendered with the the TextFSM template
              password no
                Password used to login to the target device
                index_file no index
                  name of index file. file location must be relative to the template_dir

                  Examples

                  
                  # get vlan data
                  - ntc_show_command:
                      connection=ssh
                      platform=cisco_nxos
                      command='show vlan'
                      host={{ inventory_hostname }}
                      username={{ username }}
                      password={{ password }}
                  
                  


                  Created by Network to Code, LLC For: 2015

                  ntc-ansible's People

                  Contributors

                  jedelman8 avatar mzbenami avatar jtdub avatar networkop avatar ubajze avatar ktbyers avatar ogenstad avatar

                  Recommend Projects

                  • React photo React

                    A declarative, efficient, and flexible JavaScript library for building user interfaces.

                  • Vue.js photo Vue.js

                    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

                  • Typescript photo Typescript

                    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

                  • TensorFlow photo TensorFlow

                    An Open Source Machine Learning Framework for Everyone

                  • Django photo Django

                    The Web framework for perfectionists with deadlines.

                  • D3 photo D3

                    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

                  Recommend Topics

                  • javascript

                    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

                  • web

                    Some thing interesting about web. New door for the world.

                  • server

                    A server is a program made to process requests and deliver data to clients.

                  • Machine learning

                    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

                  • Game

                    Some thing interesting about game, make everyone happy.

                  Recommend Org

                  • Facebook photo Facebook

                    We are working to build community through open source technology. NB: members must have two-factor auth.

                  • Microsoft photo Microsoft

                    Open source projects and samples from Microsoft.

                  • Google photo Google

                    Google โค๏ธ Open Source for everyone.

                  • D3 photo D3

                    Data-Driven Documents codes.