Giter Club home page Giter Club logo

ansible-cvp's Introduction

collection version License

Ansible Modules for Arista CloudVision Platform

About

Arista Networks supports Ansible for managing devices running the EOS operating system through CloudVision platform (CVP). This roles includes a set of ansible modules that perform specific configuration tasks on CVP server. These tasks include: collecting facts, managing configlets, containers, build provisionning topology and running tasks. For installation, you can refer to specific section of this readme.

Arista CloudVision and Ansible

Modules overview

This repository provides content for Ansible's collection arista.cvp with following content:

This collection supports CVP version 2018.2.x and 2019.1.x

Important notes.

This repository is built based on new collections system introduced by ansible starting version 2.9.

It means that it is required to run at least ansible 2.9.0rc4 to be able to use this collection.

Installation

Dependencies

This collection requires the following to be installed on the Ansible control machine:

  • python 2.7 and 3.x
  • ansible >= 2.9.0rc4
  • requests >= 2.22.0
  • treelib version 1.5.5 or later

Git installation for testing

You can git clone this repository and use examples folder for testing. This folder contains a set of pre-configured playbook and ansible configuration:

$ git clone https://github.com/aristanetworks/ansible-cvp.git
$ cd ansible-cvp/examples
$ make build

It is highly recommended to use a python virtual-environment to not alter your production environment.

Git installation

You can git clone this repository and use examples folder for testing. This folder contains a set of pre-configured playbook and ansible configuration:

Clone repository

$ git clone https://github.com/aristanetworks/ansible-cvp.git
$ cd ansible-cvp

Build and install collection

$ ansible-galaxy collection build --force arista/cvp
$ ansible-galaxy collection install arista.cvp.*.tar.gz

Docker for testing

The docker container approach for development can be used to ensure that everybody is using the same development environment while still being flexible enough to use the repo you are making changes in. You can inspect the Dockerfile to see what packages have been installed.

  • Build Docker with Python 2.7
$ docker build -f Dockerfile-2.7 -t ansible-cvp:latest2.7 .
$ docker exec -it --rm ansible-cvp:latest2.7 sh
  • Build Docker with Python 3.x
$ docker build -f Dockerfile-3 -t ansible-cvp:latest3 .
$ docker exec -it --rm ansible-cvp:latest3 sh

Docker images can be reduced by using --squash option available with experimental features enabled on your docker host.

All files part of examples are copied into the container.

Example playbook

This example outlines how to use arista.cvp to create a containers topology on Arista CloudVision.

Some playbook examples are provided in examples folder with information about how to built a test environment.

Below is a very basic example to build a container tology on a CloudVision platform assuming you have 3 veos named veos0{1,3} and a configlet named alias

---
- name: Playbook to demonstrate cv_container module.
  hosts: cvp
  connection: local
  gather_facts: no
  collections:
    - arista.cvp
  vars:
    containers_provision:
        Fabric:
          parent_container: Tenant
        Spines:
          parent_container: Fabric
        Leaves:
          parent_container: Fabric
          configlets:
              - alias
          devices:
            - veos03
        MLAG01:
          parent_container: Leaves
          devices:
            - veos01
            - veos02
  tasks:
    - name: "Gather CVP facts from {{inventory_hostname}}"
      cv_facts:
      register: cvp_facts

    - name: "Build Container topology on {{inventory_hostname}}"
      cv_container:
        topology: '{{containers_provision}}'
        cvp_facts: '{{cvp_facts.ansible_facts}}'
        save_topology: true

As modules of this collection are based on HTTPAPI connection plugin, authentication elements shall be declared using this plugin mechanism and are automatically shared with arista.cvp.cv_* modules.

[development]
cvp_foster  ansible_host= 10.90.224.122 ansible_httpapi_host=10.90.224.122

[development:vars]
ansible_connection=httpapi
ansible_httpapi_use_ssl=True
ansible_httpapi_validate_certs=False
ansible_user=cvpadmin
ansible_password=ansible
ansible_network_os=eos
ansible_httpapi_port=443

As modules of this collection are based on HTTPAPI connection plugin, authentication elements shall be declared using this plugin mechanism and are automatically shared with arista.cvp.cv_* modules.

Resources

License

Project is published under Apache License.

Ask a question

Support for this arista.cvp collection is provided by the community directly in this repository. Easiest way to get support is to open an issue.

Contributing

Contributing pull requests are gladly welcomed for this repository. If you are planning a big change, please start a discussion first to make sure we’ll be able to merge it.

You can also open an issue to report any problem or to submit enhancement.

A more complete guide for contribution is available in the repository

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.