Git Product home page Git Product logo

oci-drg-peering-ansible's Introduction

Ansible DRG Peering

Introduction

In this automation, you are able to peer two drgs inside of the same or from different regions. This also gets the route tables for vcns and populates them with route rules that send the traffic through the drgs.

Prerequisites

The following resources should already exist in OCI:

Compartment 2 VCNs in different / same regions 2 DRGs in different /same regions You will also need to install:

  • oci_cli
  • oci ansible modules -> ansible-galaxy collection install oracle.oci

In the root directory of the downloaded code, there are 4 files:

  • peering.ini -> Inventory file containing all the prerequisites variables
  • peering_create.yaml -> In charge of creating the drg connections and the necessary route rules
  • peering_delete.yaml -> In charge of delete the drg connection and the necessary route rules
  • populate_peering.yaml -> OPTIONAL, you may use this only if you created your resources using OCI Resource Manager to populate the route_rules_inventory file

Populating the Inventory file

In order to prepare the inventory file (peering.ini) we have to first understand what arguments we need and what are they doing:

  • first_drg - The id of the drg from the 1st region
  • compartment_first - The id of the compartment from the 1st region
  • first_vcn_id - The id of the vcn from the 1st regions
  • second_drg - The id of the drg from the 2nd region
  • compartment_second - The id of the compartment from the 2nd region
  • second_vcn_id - The id of the vcn from the 2nd region
  • second_region - The region name of the 2nd region (the first region should be available in oct-cli config)

Now that we know what types of values we have to provide in the inventory file, let's populate it according to their description.

In the end, the file should be similar to this:

[all:vars]
first_drg=ocid1...
compartment_first=ocid1...
first_vcn_id=ocid1...

second_drg=ocid1...
compartment_second=ocid1...
second_vcn_id=ocid1...
second_region=us-phoenix-1

Running the code

In order to create the connection between the drgs and the necessary route rules, you will have to go to the root directory and run the following:

ansible-playbook -i peering.ini peering_create.yaml

In less than 10 minutes, the connection will be successfully established and the route rules will be created.

If you want to delete the connection after it is created and to remove the route rules, you will simply have to run:

ansible-playbook -i peering.ini peering_delete.yaml

Again, in less than 10 minutes, the connection and route rules will be removed.

oci-drg-peering-ansible's People

Contributors

flavius-dinu avatar

Watchers

 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.