User Tools

Site Tools


network_stuff:arista:api

This is an old revision of the document!


JUNOS API / ANSIBLE
Instructions here
https://blog.codecentric.de/en/2014/08/jinja2-better-ansible-playbooks-templates/

Command to generate config:

ansible-playbook -i hosts ex.p.yaml

Destination file:

/var/tmp/build/
ansible-template-for-junos]$ cat  /var/tmp/build/switch1.gyron/tmp/main.conf.part  # many times is Here

NOTES1: Found how to format ouput of an iterated list in new lines with “join('\n')”. Check file in “/home/jaime/ansible/ansible-template-for-junos/roles/ex/templatesmain.conf.j2” !


Arista API

Ansible for Arista
Ansible in the (Linux) host machine

First of all we need >Python2.7, pip and setuptools:
To compile it Python 2.7:

tar -xvf Python-2.7.5.tgz
cd Python-2.7.5
./configure
make
sudo checkinstall

Download ansible-devel from github Compile it with source ./hacking/env-setup
Newer python versions include pip: http://tecadmin.net/install-python-2-7-on-centos-rhel/# Arista eAPI 101 . Several python examples can be found here This is a basic, simple example.
In gsites tchkwn, there is an example of a py to configure a set a vlans all at once in several switches.

EOS-4.14.8M-CommandApiGuide.pdf and browse into the correspondent active release
Arista eAPI Python Library

Python jsonrpclib
RPC / JSON-RPC specification



Ansible for EOS
http://chromaticsites.com/blog/automated-servers-and-deployments-ansible-jenkins
- Roles: “reusable abstractions” as their docs page explains. See more at: http://chromaticsites.com/blog/automated-servers-and-deployments-ansible-jenkins#sthash.i8k9rOHG.dpuf

- Playbooks

network_stuff/arista/api.1504222485.txt.gz · Last modified: (external edit)