Giter Club home page Giter Club logo

ansible-cisco-ios-example's Introduction

Example usage of Ansible Network Module on Cisco IOS

Recently Peter Sprygada announced technology preview of the new Ansible Network Modules. Ansible 2.1 will bring support for basic tasks (_command, _config, _template) for various network equpiment, most notably Cisco IOS, IOS-XR, NX-OS and Juniper Junos platforms.

This repository contains working simple example that gathers show clock output from Cisco IOS switches. Following installation procedure was verified working on Mac OS X 10.11.3. Ansible playbook was executed on Cisco C2960X, IOS 15.2(2)E1 switches.

Example usage

Install Ansible

Ensure you are using Ansible v2.1 or above:

ansible-playbook --version

If not install the latest version via your OS packager, for more information see http://docs.ansible.com/ansible/intro_installation.html

Clone this repository to your working folder

Copy of all files in this repository will be downloaded to your mac/pc/whatever.

$ git clone [email protected]:brona/ansible-cisco-ios-example.git

[Optional] Edit your hosts file

If you will be using IP addresses directly in you inventory file or if you have properly working internal DNS you can skip this step.

$ sudo nano /etc/hosts

Example hosts file on Mac OS X:

127.0.0.1 localhost
255.255.255.255 broadcasthost
::1             localhost

10.0.0.1 switch1
10.0.0.2 switch2

Edit inventory

Add all network devices you want to gather time from to inventory file.

$ cd ansible-cisco-ios-example
$ nano inventory

Example inventory file:

# Example inventory file:
[ios_devices]
switch1
switch2

Run show_clock Playbook

$ ansible-playbook show_clock.yml
Username: ...
Password: ...
...

Playbook will prompt you for username and password that will be used to log in to inventory devices. Gathered output will be printed on screen.

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.