cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7699
Views
25
Helpful
5
Replies

scripting: ansible or python? which one is better?

gavin han
Level 1
Level 1

scripting: ansible or python? which one is better? any other better scripting? I am new to scripting so I am trying to learn. which one is good scripting editor (the one with command assistant)? any good tutorial for cisco automation using these scripting?

5 Replies 5

pdub206
Level 1
Level 1

I like Python just because of how easy it is to learn.  It reads more in a human language in my opinion.  Check out "Automate the Boring Stuff" and "Learn Python the Hard Way".

Throwing packets since 2012

Thanks! any good python editor? I know eclipse but it isn't free.

If you use Linux or Mac, you can use the terminal/console python interpreter.  If you use Windows, you can get IDLE python which is kind of cool.

Automate the Boring Stuff uses IDLE in their videos.  Also I would recommend learning Python 3.x and ignore anything lower.

Please mark answers as helpful or rate if I answered your question! :)

Throwing packets since 2012

If you use Windows, Visual Studio is a great option:  It is free (Community) but will require some minor configuration for making it work with Python.  Once it is done, you will hardly find something better, especially the debugger.

I use 2015 but 2017 was just released and I haven't tried it yet.

Hope this helps.

Sean.Cavanaugh
Level 1
Level 1

While I am obviously biased I think Ansible helps you not reinvent the wheel.  There is already hundreds of modules for networking, including support for Arista (EOS), Cisco (NXOS, IOS-XR, IOS-XE, ASA, ACI, etc), Juniper (EOS), Cumulus Linux and much more.  Each networking module has a documentation section with examples of how to use it: http://docs.ansible.com/ansible/latest/list_of_network_modules.html.

 

In addition we are starting to put out LOADS more examples in regards to Cisco networking and comparisons to other tools out there.  Check out this Github repo I made on Ansible and NAPALM: https://github.com/network-automation/ansible-napalm-samples.

 

I also highly recommend joining us on IRC (#ansible-network on freenode), and joining networktocode slack (http://networktocode.herokuapp.com/) where you should join the #ansible channel.  I will try to monitor the Cisco forums more frequently to help people like yourself.

---
- hosts: cisco
  connection: local
  tasks:
    - nxos_config:
        backup: yes
        provider: "{{login_info}}"
  vars:
    login_info:
      username: admin
      password: Bullf00d

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: