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 Addressing Analysis Ansible Architecture ARP AToM Baseline BGP Bloom's Taxonomy Broadband Cable cat CellStream Cellular Central Office Cheat Sheet Chrome Cisco Cloud CMD Coloring Rules Computer Consulting Customer Support Data Center Data Networking DHCPv6 DNS Docker Documentation Dublin-Traceroute dumpcap ECMP Ethernet Ethics Evaluation Field Operations Fragmentation G-MPLS GeoIP Git GNS3 Google GQUIC Hands-On History Home Network ICMP ICMPv6 IEEE 802.11p IEEE 802.15.4 India Interface Control Internet IoT IPsec IPv4 IPv6 IRINN IS-IS L2VPN L3VPN LDP Linux LLN LoL M-BGP MAC Macro Microsoft mininet Monitoring MPLS mtr MTU Multicast Name Resolution Netcat Netmiko NetMon netsh Networking Network Science nmap Npcap NSE Observations Online School OpenFlow OSPF OSPFv2 OSPFv3 OSX OTT Paris-Traceroute Parrot PIM PMTU Policy POTS POTS to Pipes PPP Profile Programming Project Management PW3E Python QoS QUIC Remote Desktop Requirements Resume RIP Routing RPL RSVP Rural SDN Security Service Provider Small Business SONET Speed SS7 SSH SSL Subnetting SYSCTL T-Shark TCP TCP/IP Telco Telecom 101 Telecommunications Telephone termshark Testing TLS 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 Winpcap Wireless Wireless 5G Wireshark Wireshark Tip WLAN Writing Zenmap ZigBee

Twitter Feed