This collection is to provide an easier way to interact with Juniper

Overview

Ansible Collection - cremsburg.apstra

N|Solid

Overview

The goal of this collection is to provide an easier way to interact with Juniper's Apstra solution. While nothing will stop you from using the built-in module, you may find that working with pre-packaged modules can help simplify the development of your playbook, or it may just be easier to support as a team.

📋 Ansible version compatibility

There are significant changes to Ansible within version 3.x, and while those changes get worked out we will continue to test for Ansible 2.10.x.

It is very likely that something will break on Ansible 3.x versions as of this pre-release version of the project.

⚙️ Batteries Included

Here is a short list of modules included within the collection, expect feature parity with the Swagger before this project hits version 0.1.0

Name Description
cremsburg.apstra.blueprint Manage Blueprints
cremsburg.apstra.design Manage the Design elements
cremsburg.apstra.resources Manage the Resources elements

🚀 Executing the playbook

After installing the collections, you can call the modules by using their full name path.

test.yaml

---
- hosts: localhost
  gather_facts: False
  become: False
  tasks:
    
    - name: Manage an IP Pool Resource with two prefixes
      cremsburg.apstra.resources:
        # define server connectivity options
        server: apstra.dmz.home
        api_token: "{{ api_token }}"

        # define resource allocations
        display_name: "cicd_test"
        type: "ip-pool"
        subnets:
          - "100.1.1.0/24"
          - "100.1.2.0/24"

        # state whether you want to create or delete this resource
        state: present

Then simply run your playbook

ansible-playbook test.yaml

If you used Ansible Vault to encrypt your secrets, you need to append the --ask-vault-pass to your command.

⚠️ Very Important! ⚠️

Please make sure to manage your sensative information carfully. While the modules support the parameter of api_key, this should never be statically entered with your token in clear text.

Here are better alternatives:

Manage your API token as an environmental

export APSTRA_API_TOKEN='YOUR_PRIVATE_KEY_HERE'

you can also use APSTRA_API_KEY, if you prefer

Manage your API token as a secret with Ansible Vault

create a file to store your API token in

$ vim vault.yaml

api_token: "MY_APSTRA_API_TOKEN_HERE"

encrypt the new file

ansible-vault encrypt vault.yml

and now you'll need to pass your vault password when using the playbook

ansible-playbook --ask-vault-pass test.yaml

Development

Want to contribute? Great!

Submit a PR and let's work on this together :D

You might also like...
A project to explore and provide useful code for Mango Markets

🥭 Mango Explorer A project to explore and provide useful code for Mango Markets

1cak - An Indonesian web that provide lot of fun.

An unofficial API of 1cak.com 1cak - An Indonesian web that provide lot of fun. Endpoint Lol - 10 Recent stored posts on database Example: https://on

Aerial Ace is a helper bot for poketwo which provide various functionalities on top of being a pokedex.

Aerial Ace is a helper bot for poketwo which provide various functionalities on top of being a pokedex.

Provide error messages for Python exceptions, even if the original message is empty

errortext is a Python package to provide error messages for Python exceptions, even if the original message is empty.

Package to provide translation methods for pyramid, and means to reload translations without stopping the application

Package to provide translation methods for pyramid, and means to reload translations without stopping the application

Supply Chain will be a SAAS platfom to provide e-logistic facilites with most optimal

Shipp It Welcome To Supply Chain App [ Shipp It ] In "Shipp It" we are creating a full solution[web+app] for a entire supply chain from receiving orde

Blender Light Manipulation - A script that makes it easier to work with light
Blender Light Manipulation - A script that makes it easier to work with light

Blender Light Manipulation A script that makes it easier to work with light 1. Wstęp W poniższej dokumentacji przedstawiony zostanie skrypt, który swo

ARA Records Ansible and makes it easier to understand and troubleshoot.
ARA Records Ansible and makes it easier to understand and troubleshoot.

ARA Records Ansible ARA Records Ansible and makes it easier to understand and troubleshoot. It's another recursive acronym. What it does Simple to ins

Providing a working, flexible, easier and faster installer than the one officially provided by Arch Linux
Providing a working, flexible, easier and faster installer than the one officially provided by Arch Linux

Purpose The purpose is to bring more people to Arch Linux by providing a working, flexible, easier and faster installer than the one officially provid

Owner
Calvin Remsburg
check out the Stars tab for some much needed organization
Calvin Remsburg
A Way to Use Python, Easier.

PyTools A Way to Use Python, Easier. How to Install Just copy this code, then make a new file in your project directory called PyTools.py, then paste

Kamran 2 Aug 15, 2022
A collection of existing KGQA datasets in the form of the huggingface datasets library, aiming to provide an easy-to-use access to them.

KGQA Datasets Brief Introduction This repository is a collection of existing KGQA datasets in the form of the huggingface datasets library, aiming to

Semantic Systems research group 21 Jan 6, 2023
Attempt at creating organized collection of little handy snippets of code I'm receiving along the way

ChaosCode Attempt at creating organized collection of little handy snippets of code I'm receiving along the way I always considered coding and program

INFU 4 Nov 26, 2022
A lightweight Python module to interact with the Mitre Att&ck Enterprise dataset.

enterpriseattack - Mitre's Enterprise Att&ck A lightweight Python module to interact with the Mitre Att&ck Enterprise dataset. Built to be used in pro

xakepnz 7 Jan 1, 2023
pyToledo is a Python library to interact with the common virtual learning environment for the Association KU Leuven (Toledo).

pyToledo pyToledo is a Python library to interact with the common virtual learning environment for the Association KU Leuven a.k.a Toledo. Motivation

Daan Vervacke 5 Jan 3, 2022
Python scripts to interact with Upper Deck ePack online trading card platform

This script should connect to the Upper Deck ePack API using your browser cookies and download a list of your current collection and save it as a CSV.

Adrian Kent 1 Nov 22, 2021
A web-based chat application that enables multiple users to interact with one another

A web-based chat application that enables multiple users to interact with one another, in the same chat room or different ones according to their choosing.

null 3 Apr 22, 2022
Python library to interact with Move Hub / PoweredUp Hubs

Python library to interact with Move Hub / PoweredUp Hubs Move Hub is central controller block of LEGO® Boost Robotics Set. In fact, Move Hub is just

Andrey Pokhilko 499 Jan 4, 2023
Provide Prometheus url_sd compatible API Endpoint with data from Netbox

netbox-plugin-prometheus-sd Provide Prometheus http_sd compatible API Endpoint with data from Netbox. HTTP SD is a new feature in Prometheus and not a

Felix Peters 66 Dec 19, 2022
The purpose of this script is to bypass disablefund, provide some useful information, and dig the hook function of PHP extension.

The purpose of this script is to bypass disablefund, provide some useful information, and dig the hook function of PHP extension.

Firebasky 14 Aug 2, 2021