Networking/Computing Tips/Tricks

Ansible is a tool used to automate Server provisioning and network provisioning.  Ansible is completely free!  You can dive deep into Ansible at their web site.

A great way to learn Ansible as a network automation tool is to use it in an emulated network environment. GNS3 fits that requirement perfectly.  GNS3 is also completely free!

As many of you know, we have been users of GNS3 since forever, plus we were part of their crowd sourcing!

GNS3 has evolved tremendously in the past years. Using the versions after 2.x brings great functionality into GNS3 including Ansible. We strongly urge students to use GNS3 to learn Ansible. If you want to learn how to install and use GNS3, there is a separate reference here.  Assuming you have version 2.x or later of GNS3 running, we will show how to accomplish this in a couple of simple videos below.

Even if you have never used GNS3, you can watch the videos below to get a clear understanding of how Ansible works!

Watch this video first to see exactly how to get Ansible with your GNS3 environment.

Install Ansible in GNS3 from Andrew Walding on Vimeo.

 The next step is to configure IP addresses:



 Here is the router configuration used:

configure terminal
hostname R1
alias exec s show run
alias exec c config terminal
alias exec i show ip interface brief
alias exec ipr show ip route
ip tcp synwait 5
no service timestamps
no service time debug
line console 0
no login
no exec-timeout
logging synch
privilege level 15
line aux 0
no login
no exec-timeout
logging synch
privilege level 15
line vty 0 4
login local
transport input all
ip domain-name
crypto key generate rsa
interface f0/0
ip address
no shutdown
username student pass csi123
username student priv 15

Now let's add some routers into the topology:


 Now it is time to set up a simple Ansible environment. We will create a simple ansible.cfg file and a hosts file so ansible will be able to work with our routers:


 It's finally time to actually create an Ansible playbook and run it against our topology. You will find the playbook1.yml file available to download below the video.


 Here is the playbook1.yml content:

- name: Install OSPF
  hosts: [gns3routers]
  gather_facts: false
  connection: local

      username: student
      password: csi123
      transport: cli

    - name: enable ospf
        provider: "{{ cli }}"
        authorize: yes
        parents: router ospf 1
          - network area 0

      register: print_output

    - debug: var=print_output



Comments powered by CComment

Find by Tag

4G Networks 5G Networks 6LoWLAN 6LoWPAN 802.11 802.11ah 802.11ax 802.11ay 802.11az Ad-Hoc Addressing Analysis Ansible Architecture ARP Assessment AToM Automation Baseline BGP Bloom's Taxonomy Bluehost Cable cat CellStream Cellular Central Office Cheat Sheet Chrome Cisco Cloud CMD Company Policy Computer Consulting Data Center Data Networking Dependencies DHCPv6 DNS Docker Documentation Dublin-Traceroute dumpcap Earth Earthquakes ECMP Ethernet Ethics Etiquette Evaluation Field Operations Five Monkey Rule G-MPLS Gauge GeoIP GNS3 Google GQUIC Hands-On History Home Network ICMP ICMPv6 IEEE 802.11p IEEE 802.15.4 India Internet IoT IPv4 IPv6 IRINN IS-IS L2VPN L3VPN LDP LifeNet Linux LLN LoL M-BGP MAC Macro Microsoft Milky Way mininet Monitoring MPLS mtr Multicast Murphy Name Resolution Netcat NetMon netsh Networking nmap NSE Observations OLPC Online School OpenFlow OSPF OSPFv2 OSPFv3 OSX OTT Paris-Traceroute Parrot PIM Policy POTS POTS to Pipes PPP Profile Project Management PW3E QoS QUIC Railroad Remote Desktop Requirements Resume Review RIP Routing RPL RSVP Rural SDN Security Service Provider Small Business SONET Speed SSL Status Storms Subnetting Support SYSCTL T-Shark TCP TCP/IP Telco Telecom 101 Telecommunications Telephone Testing Tools Traceroute Traffic Engineering Training Travel Tunnel Ubuntu Utility Video Virtualbox Virtualization VoIP VRF VXLAN Wi-Fi Wi-Fi 4 Wi-Fi 5 Wi-Fi 6 Windows Wireless Wireless 5G Wireshark WLAN Writing Zenmap ZigBee

Twitter Feed