GithubHelp home page GithubHelp logo

jnpr-formalfabric's Introduction

Gratitude

I am basically taking Khelil's stuff, modifying it, and then using GitHub to organize it into my lab environment (while backing up and storing my files) and learning a ton of new stuff.

https://github.com/ksator/junos-automation-with-ansible <--- His stuff is located here.

https://github.com/ksator/lab_management <--- And even more stuff here.

I don't know that I'll ever get to the awesome part of this but I keep working on it.

Install instructions

Build a basic Ubuntu 16.04 Server and don't update it. Follow the instructions below.

Get the content of the remote repository locally

sudo -s
git clone https://github.com/packetjanitor/JNPR-FormalFabric.git
ls JNPR-FormalFabric

Move to the local copy of the remote repo

cd JNPR-FormalFabric
sudo -s

Install PyEZ, Jxmlease, Ansible, JSNAPy and all their dependencies

This repository has been tested using Ansible 2.4.2.0

Run these commands on Ubuntu 16.04 to install these tools:

sudo -s
apt-get update
apt-get upgrade
apt-get install -y python-dev libxml2-dev python-pip libxslt1-dev build-essential libssl-dev libffi-dev git
pip install junos-eznc jxmlease wget jsnapy ansible==2.4.2.0 requests ipaddress cryptography
ansible-galaxy install Juniper.junos,1.4.3

Check the Ansible version:
ansible --version

Verify you have the Juniper.junos role:
ls /etc/ansible/roles/

This repository has been tested using the version 1.4.3 of the Juniper.junos role available on Galaxy. Use this command to see the name and version of each role installed:

ansible-galaxy list

Permission problems

I know running everything with sudo -s will put alot of it in root's control and thus a hassle to execute as a normal user. Here's how to solve that...

ls -al

chown <username>:<username> NameOfDirectory or FileName <br />

Configure NETCONF on the Junos devices

set system services netconf ssh
commit

Repository structure

Inventory file:

The inventory file we are using in this repository is hosts.

It is at the root of the repository, so it is not at the default place.
It defines the inventory (hosts and groups).
It also defines the ip address of each device with the variable junos_host. This variable is re-used in the playbooks.

Config file for ansible

There is an ansible.cfg file at the root of the repository. It refers to our inventory file: So even if the inventory file is not in /etc/ansible/hosts, there is no need to add -i hosts to your ansible-playbook commands.

Variables

group_vars and host_vars directories at the root of this repository define variables for hosts and for groups. The inventory file hosts at the root of the repository also defines some variables. The playbooks in this directory use all of them. Some playbooks also use other variables. In order to see all variables for a hostname, you can run this command:

ansible -m debug -a "var=hostvars['hostname']" localhost

Travis CI Status

Build Status

More to come... Stay Tuned

jnpr-formalfabric's People

Contributors

packetjanitor avatar ksator avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.