Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:napalm-automation/napalm into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
dbarrosop committed Sep 12, 2016
2 parents 1c55342 + 734d3d2 commit bf91daf
Show file tree
Hide file tree
Showing 18 changed files with 382 additions and 73 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ env

test/unit/test_devices.py

.vagrant
7 changes: 4 additions & 3 deletions docs/hackathons/hackathon2016/agenda.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ ______
Friday 16th of Sept
^^^^^^^^^^^^^^^^^^^

* **6.00 pm - 7.00 pm** - Kick off. Short introduction about napalm and the hackathon.
* **7.00 pm - 8.00 pm** - Propose tasks, create teams...
* **7.00 pm - 11.59 pm** - Hacking.
* **6.00 pm - 7.00 pm** - Kick off. Short introduction about napalm, news about the project, vision for the future and some basic information about the hackathon.
* **7.00 pm - 7.30 pm** - Keynote: Ivan Pepelnjak - ipSpace.net
* **7.30 pm - 8.30 pm** - Propose tasks, create teams...
* **8.30 pm - 11.59 pm** - Hacking.

Saturday 17th of Sept
^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion docs/hackathons/hackathon2016/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Quick Information
-----------------

+-----------------+-----------------------------------------------+
| **Date** | 17, 18 and 19th of September |
| **Date** | 16, 17 and 18th of September |
+-----------------+-----------------------------------------------+
| **Location** | :doc:`Here for more information <locations>` |
+-----------------+-----------------------------------------------+
Expand Down
13 changes: 12 additions & 1 deletion docs/hackathons/hackathon2016/locations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ Apparently there is something called real life and people like to gather in grou
Known gatherings
^^^^^^^^^^^^^^^^

* London, exact location TBD
* London, UK::

CloudFlare, 25 Lavington St, London SE1 0NZ
Contact: Mircea, @mirceaulinic (slack), tel: +447427735256

* San Francisco, United states::

Contact ktbyers@twb-tech.com for details

* Krakow, Poland::

Contact elisa@bigwaveit.org for details



Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Documentation
.. toctree::
:maxdepth: 2

installation
tutorials/index
support/index
cli
Expand Down
75 changes: 75 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Installation
============

Dependencies
------------

Some of the available drivers depend on the Python [cryptography](https://cryptography.io/en/latest/) package.

These drivers currently include:

* `napalm_ios`

To to ensure all dependencies are met for these drivers, use the following commands:

**Debian/Ubuntu**:

```
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
```

**Fedora and RHEL-derivatives**:

```
sudo yum install gcc libffi-devel python-devel openssl-devel
```


Full installation
-----------------

If you want to fully install NAPALM you can do it by executing:

```
pip install napalm
```

That will install all the drivers currently available.


Partial Installation
--------------------

If you want to install just a subset of the available modules you can just pick them as follows:

```
pip install napalm-eos napalm-junos
```

That will install only the `eos` and the `junos` drivers. If you want to remove or add a module later on you can just use `pip` to do it:

```
pip uninstall napalm-junos
pip install napalm-ios
```

Check the ['Supported Network Operating Systems'](http://napalm.readthedocs.io/en/latest/support/index.html) section for more information about supported modules.


Upgrading
=========

We plan to upgrade napalm as fast as possible. Adding new methods and bugfixes. To upgrade napalm it's a simple as repeating the steps you performed while installing but adding the `-U` flag. For example:

```
pip install napalm -U
```

or:

```
pip install napalm-eos napalm-junos -U
```

We will be posting news on our slack channel and on Twitter (more details soon).

7 changes: 4 additions & 3 deletions docs/support/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ _ EOS JunOS IOS-XR FortiOS IBM
**Config. replace** Yes Yes Yes Yes Yes [#c3]_ Yes Yes No Yes
**Config. merge** Yes Yes Yes Yes Yes Yes Yes No Yes
**Compare config** Yes Yes Yes [#c1]_ Yes [#c1]_ Yes [#c1]_ Yes [#c4]_ Yes No Yes
**Atomic Changes** Yes Yes Yes No [#c2]_ No [#c2]_ Yes/No [#c5]_ Yes Yes Yes/No [#c5]_
**Atomic Changes** Yes Yes Yes No [#c2]_ No [#c2]_ Yes/No [#c5]_ Yes Yes Yes/No [#c5]_
**Rollback** Yes [#c2]_ Yes Yes Yes Yes [#c2]_ Yes/No [#c5]_ Yes No Yes
===================== ========== ===== ========== ============== ============= ============== ============== ============== ==============

Expand Down Expand Up @@ -76,12 +76,13 @@ _ EOS JunOS IOS-XR FortiOS IBM NXOS I
**get_lldp_neighbors** |yes| |yes| |yes| |yes| |no| |no| |yes| |yes| |no|
**get_lldp_neighbors_detail** |yes| |yes| |yes| |no| |no| |yes| |yes| |yes| |no|
**get_bgp_neighbors** |yes| |yes| |yes| |yes| |no| |no| |yes| |no| |no|
**get_bgp_neighbors_detail** |no| |yes| |yes| |no| |no| |no| |no| |no| |no|
**get_bgp_neighbors_detail** |yes| |yes| |yes| |no| |no| |no| |no| |no| |no|
**get_bgp_config** |yes| |yes| |yes| |no| |no| |no| |no| |no| |no|
**get_route_to** |yes| |yes| |yes| |no| |no| |no| |no| |no| |no|
**get_probes_config** |no| |yes| |yes| |no| |no| |no| |no| |no| |no|
**get_probes_results** |no| |yes| |yes| |no| |no| |no| |no| |no| |no|
**get_users** |yes| |yes| |yes| |no| |no| |yes| |no| |yes| |no|
**get_optics** |yes| |yes| |yes| |no| |no| |no| |no| |no| |no|
============================== ===== ===== ====== ======= ====== ====== ===== ========= =========

Other methods
Expand All @@ -93,7 +94,7 @@ Other methods
============================== ===== ===== ====== ======= ====== ====== ===== ========= =========
_ EOS JunOS IOS-XR FortiOS IBM NXOS IOS Pluribus PANOS
============================== ===== ===== ====== ======= ====== ====== ===== ========= =========
**load_template** |yes| |yes| |yes| |yes| |yes| |yes| |yes| |yes| |yes|
**load_template** |yes| |yes| |yes| |yes| |yes| |yes| |yes| |yes| |yes|
**ping** |no| |no| |no| |no| |no| |no| |yes| |no| |no|
**traceroute** |yes| |yes| |yes| |no| |no| |yes| |no| |yes| |no|
============================== ===== ===== ====== ======= ====== ====== ===== ========= =========
Expand Down
30 changes: 30 additions & 0 deletions docs/tutorials/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Vagrantfile for the quickstart tutorial

# Script configuration:
#
# Arista vEOS box.
# Please change this to match your installed version
# (use `vagrant box list` to see what you have installed).
VEOS_BOX = "vEOS-lab-4.15.5M-virtualbox"

Vagrant.configure(2) do |config|

config.vm.define "base" do |base|
# This box will be downloaded and added automatically if you don't
# have it already.
base.vm.box = "hashicorp/precise64"
base.vm.network :forwarded_port, guest: 22, host: 12200, id: 'ssh'
base.vm.network "private_network", virtualbox__intnet: "link_1", ip: "10.0.1.100"
base.vm.network "private_network", virtualbox__intnet: "link_2", ip: "10.0.2.100"
base.vm.provision "shell", inline: "apt-get update; apt-get install lldpd -y"
end

config.vm.define "eos" do |eos|
eos.vm.box = VEOS_BOX
eos.vm.network :forwarded_port, guest: 22, host: 12201, id: 'ssh'
eos.vm.network :forwarded_port, guest: 443, host: 12443, id: 'https'
eos.vm.network "private_network", virtualbox__intnet: "link_1", ip: "169.254.1.11", auto_config: false
eos.vm.network "private_network", virtualbox__intnet: "link_2", ip: "169.254.1.11", auto_config: false
end

end
6 changes: 6 additions & 0 deletions docs/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ Tutorials
.. toctree::
:maxdepth: 1

outline
installation
lab
samples
../cli.rst
first_steps_config
context_manager
wrapup
78 changes: 13 additions & 65 deletions docs/tutorials/installation.rst
Original file line number Diff line number Diff line change
@@ -1,76 +1,24 @@
Installation
============

Dependencies
------------
Tools
-----

Some of the available drivers depend on the Python [cryptography](https://cryptography.io/en/latest/) package.
You'll need a few tools:

These drivers currently include:
* Python
* `pip <https://pip.pypa.io/en/stable/installing/>`_: The PyPA recommended tool for installing Python packages
* `VirtualBox <https://www.virtualbox.org/>`_: a software virtualization tool
* `Vagrant <https://www.vagrantup.com/downloads.html>`_: a command line utility for managing the lifecycle of virtual machines

* `napalm_ios`
As the focus of this tutorial is NAPALM, we don't even scratch the surface of these tools. If you're not familiar with them, please do some research [#f1]_ as they will be an important part of your development/ops toolkit.

To to ensure all dependencies are met for these drivers, use the following commands:
Install
-------

**Debian/Ubuntu**:
Install NAPALM with pip::

```
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
```

**Fedora and RHEL-derivatives**:

```
sudo yum install gcc libffi-devel python-devel openssl-devel
```


Full installation
-----------------

If you want to fully install NAPALM you can do it by executing:

```
pip install napalm
```

That will install all the drivers currently available.


Partial Installation
--------------------

If you want to install just a subset of the available modules you can just pick them as follows:

```
pip install napalm-eos napalm-junos
```

That will install only the `eos` and the `junos` drivers. If you want to remove or add a module later on you can just use `pip` to do it:

```
pip uninstall napalm-junos
pip install napalm-ios
```

Check the ['Supported Network Operating Systems'](http://napalm.readthedocs.io/en/latest/support/index.html) section for more information about supported modules.


Upgrading
=========

We plan to upgrade napalm as fast as possible. Adding new methods and bugfixes. To upgrade napalm it's a simple as repeating the steps you performed while installing but adding the `-U` flag. For example:

```
pip install napalm -U
```

or:

```
pip install napalm-eos napalm-junos -U
```

We will be posting news on our slack channel and on Twitter (more details soon).
pip install napalm


.. [#f1] Vagrant's `getting started guide <https://www.vagrantup.com/docs/getting-started/>`_ is worth reading and working through.
69 changes: 69 additions & 0 deletions docs/tutorials/lab.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Setting up the lab
==================

We'll set up a lab using VirtualBox and Vagrant, with a virtual Arista device, and get some sample files for the following steps.

Working directory
-----------------

Create a directory for your files anywhere on your machine.

Arista vEOS
-----------

The Arista EOS image can be downloaded for free from the Arista site.

Create an account at https://www.arista.com/en/user-registration, and go to https://www.arista.com/en/support/software-download.

Download the latest "vEOS-lab-<version>-virtualbox.box" listed in the vEOS folder at the bottom of the page.

Add it to your vagrant box list, changing the `<version>`::

$ vagrant box add --name vEOS-lab-<version>-virtualbox ~/Downloads/vEOS-lab-<version>-virtualbox.box
$ vagrant box list
vEOS-lab-quickstart (virtualbox, 0)

You can delete the downloaded .box file once you have added it, as ``vagrant box add`` copies downloaded file to a designated directory (e.g., for Mac OS X and Linux: ``~/.vagrant.d/boxes``, Windows: ``C:/Users/USERNAME/.vagrant.d/boxes``).

Starting Vagrant
----------------

Create a file named ``Vagrantfile`` (no file extension) in your working directory with the following content:

.. literalinclude:: Vagrantfile
:language: ruby

The above content is also available on `GitHub <https://raw.githubusercontent.com/napalm-automation/napalm/master/docs/tutorials/Vagrantfile>`_.

This Vagrantfile creates a base box and a vEOS box when you call "vagrant up"::

$ vagrant up
... [output omitted] ...

$ vagrant status
Current machine states:
base running (virtualbox)
eos running (virtualbox)

You may see some errors when the eos box is getting created [#f1]_.

Troubleshooting
^^^^^^^^^^^^^^^

* After running ``vagrant up``, ensure that you can ssh to the box with ``vagrant ssh eos``.
* If you receive the warning "eos: Warning: Remote connection disconnect. Retrying...", see `this StackOverflow post <http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying>`_.

Sample files
------------

There are some sample Arista vEOS configuration files on `GitHub <https://github.com/napalm-automation/napalm/blob/master/docs/tutorials/sample_configs>`_. You can download them to your machine by copying them from GitHub, or using the commands below::

$ for f in new_good.conf merge_good.conf merge_typo.conf; do
$ wget https://raw.githubusercontent.com/napalm-automation/napalm/master/docs/tutorials/sample_configs/$f
$ done

(Note: please open a GitHub issue if these URLs are invalid.)


.. [#f1] Currently, ``vagrant up`` with the eos box prints some warnings: "No guest additions were detected on the base box for this VM! Guest additions are required for forwarded ports, shared folders, host only networking, and more. If SSH fails on this machine, please install the guest additions and repackage the box to continue. This is not an error message; everything may continue to work properly, in which case you may ignore this message." This is not a reassuring message, but everything still seems to work correctly.
11 changes: 11 additions & 0 deletions docs/tutorials/outline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Outline
=======

This tutorial gets you up-and-running quickly with NAPALM in a local virtual environment so you can see it in action in under an hour. We'll cover the following:

#. Installing the required tools
#. Creating a virtual lab with an Arista device
#. Manually applying configuration to the device using NAPALM
#. Driving NAPALM through Python code

.. note:: This tutorial does not cover fully automated configuration management (e.g., using NAPALM in conjunction with Ansible, Chef, Salt, etc.). We hope that tutorials for these tools will be contributed soon so that you can evaluate the options for your particular environment.
4 changes: 4 additions & 0 deletions docs/tutorials/sample_configs/merge_good.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
hostname NEWHOSTNAME

interface Ethernet2
description BLALALAL
4 changes: 4 additions & 0 deletions docs/tutorials/sample_configs/merge_typo.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
hostname NEWHOSTNAME

interface Ethernet2
descriptin BLALALAL

0 comments on commit bf91daf

Please sign in to comment.