| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| network_stuff:arista:api [2015/08/05 13:05] – jotasan | network_stuff:arista:api [2023/11/02 14:38] (current) – external edit 127.0.0.1 |
|---|
| | __**JUNOS API / ANSIBLE**__\\ |
| | Instructions [[https://github.com/dgjnpr/ansible-template-for-junos|here]]\\ |
| | [[http://example.com|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 |
| | |
| | update1: Found how to format ouput of an iterated list with new lines in the output using: |
| | {{ int.iface|join('\n')}} # Check file in "/home/jaime/ansible/ansible-template-for-junos/roles/ex/templatesmain.conf.j2" ! |
| | |
| | |
| | |
| | ---- |
| | |
| __**Arista API**__\\ | __**Arista API**__\\ |
| [[https://eos.arista.com/arista-eapi-101/|Arista eAPI 101]] | |
| | [[https://sreeninet.wordpress.com/2015/05/11/ansible-for-arista-eos/|Ansible for Arista]] \\ |
| | [[http://www.twine-networks.com/blog/posts/7-how-to-junos-host-zone|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/#]] |
| | [[https://eos.arista.com/arista-eapi-101/|Arista eAPI 101]] . Several python examples can be found here |
| | This is a basic, simple [[https://fredhsu.wordpress.com/2014/02/13/arista-json-eapi-example/|example]].\\ |
| | In gsites tchkwn, there is an [[https://sites.google.com/site/techknw/home/scr|example]] of a py to configure a set a vlans all at once in several switches.\\ |
| \\ | \\ |
| [[https://www.arista.com/en/support/software-download|EOS-4.14.8M-CommandApiGuide.pdf]]\\ | [[https://www.arista.com/en/support/software-download|EOS-4.14.8M-CommandApiGuide.pdf]] and browse into the correspondent active release\\ |
| [[https://github.com/arista-eosplus/pyeapi|Arista eAPI Python Library]]\\ | [[https://github.com/arista-eosplus/pyeapi|Arista eAPI Python Library]]\\ |
| \\ | \\ |
| Python RPC / JSON-RPC:\\ | Python |
| jsonrpclib\\ | jsonrpclib\\ |
| | RPC / JSON-RPC [[http://www.jsonrpc.org/specification|specification]] |
| |
| |
| \\ | \\ |
| \\ | \\ |
| [[https://sreeninet.wordpress.com/2015/05/11/ansible-for-arista-eos/|Ansible for EOS]] | [[https://sreeninet.wordpress.com/2015/05/11/ansible-for-arista-eos/|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 |