community.skydive.skydive_edge (1.0.0) — module

Module to add edges to Skydive topology

Authors: Sumit Jaiswal (@sjaiswal)

preview | supported by network

Install collection

Install with ansible-galaxy collection install community.skydive:==1.0.0


Add to requirements.yml

  collections:
    - name: community.skydive
      version: 1.0.0

Description

This module handles setting up edges between two nodes based on the relationship type to the Skydive topology.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create tor
  community.skydive.skydive_node:
    name: 'TOR'
    node_type: "fabric"
    seed: TOR
    metadata:
      Model: Cisco xxxx
    provider:
      endpoint: localhost:8082
      username: admin
      password: admin
  register: tor_result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create port 1
  community.skydive.skydive_node:
    name: 'PORT1'
    node_type: 'fabric'
    seed: PORT1
    provider:
      endpoint: localhost:8082
      username: admin
      password: admin
  register: port1_result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create port 2
  community.skydive.skydive_node:
    name: 'PORT2'
    node_type: 'fabric'
    seed: PORT2
    provider:
      endpoint: localhost:8082
      username: admin
      password: admin
  register: port2_result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: link node tor and port 1
  community.skydive.skydive_edge:
    parent_node: "{{ tor_result.UUID }}"
    child_node: "{{ port1_result.UUID }}"
    relation_type: ownership
    state: present
    provider:
      endpoint: localhost:8082
      username: admin
      password: admin
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: link node tor and port 2
  community.skydive.skydive_edge:
    parent_node: "{{ tor_result.UUID }}"
    child_node: "{{ port2_result.UUID }}"
    relation_type: ownership
    state: present
    provider:
      endpoint: localhost:8082
      username: admin
      password: admin
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: update link node tor and port 1 relation
  community.skydive.skydive_edge:
    parent_node: "{{ tor_result.UUID }}"
    child_node: "{{ port2_result.UUID }}"
    relation_type: layer2
    state: upadte
    provider:
      endpoint: localhost:8082
      username: admin
      password: admin
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Unlink tor and port 2
  community.skydive.skydive_edge:
    parent_node: "{{ tor_result.UUID }}"
    child_node: "{{ port2_result.UUID }}"
    relation_type: ownership
    state: absent
    provider:
      endpoint: localhost:8082
      username: admin
      password: admin
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: link tor and port 2 via Gremlin expression
  community.skydive.skydive_edge:
    parent_node: G.V().Has('Name', 'TOR')
    child_node: G.V().Has('Name', 'PORT2')
    relation_type: ownership
    state: present
    provider:
      endpoint: localhost:8082
      username: admin
      password: admin
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Unlink tor and port 2 via Gremlin expression
  community.skydive.skydive_edge:
    parent_node: G.V().Has('Name', 'TOR')
    child_node: G.V().Has('Name', 'PORT2')
    relation_type: ownership
    state: absent
    provider:
      endpoint: localhost:8082
      username: admin
      password: admin

Inputs

    
host:
    default: ''
    description:
    - To define the host of the node.
    required: false

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the Skydive Edge. If value is I(present) new edge will be created else
      if it is I(absent) it will be deleted.

metadata:
    description:
    - To define metadata for the edge.
    required: false

provider:
    description:
    - A dict object containing connection details.
    suboptions:
      endpoint:
        description:
        - Specifies the hostname/address along with the port as C(localhost:8082)for connecting
          to the remote instance of SKYDIVE client over the REST API.
        required: true
      insecure:
        default: false
        description:
        - Ignore SSL certification verification.
        type: bool
      password:
        description:
        - Specifies the password to use to authenticate the connection to the remote instance
          of SKYDIVE client.
      ssl:
        default: false
        description:
        - Specifies the ssl parameter that decides if the connection type shall be http
          or https.
        type: bool
      user:
        description:
        - Configures the username to use to authenticate the connection to the remote
          instance of SKYDIVE client.

child_node:
    description:
    - To defined the second node of the link, it can be either an ID or a gremlin expression
    required: true

parent_node:
    description:
    - To defined the first node of the link, it can be either an ID or a gremlin expression
    required: true

relation_type:
    description:
    - To define relation type of the node I(ownership, layer2, layer3).
    required: true