Skip to main content

F5 plugins for Nornir

Project description

nornir_f5

Build Status codecov made-with-python Python Version Code style: black GitHub license

F5 plugins for Nornir.

Installation

Pip

pip install nornir_f5

Poetry

poetry add nornir_f5

Usage

from nornir import InitNornir
from nornir.core.task import Result, Task
from nornir_utils.plugins.functions import print_result

from nornir_f5.plugins.tasks import (
    f5_atc,
    f5_bigip_cm_failover_status,
    f5_bigip_cm_sync_config,
)

def as3_post(task: Task, as3_tenant: str) -> Result:
    # Get the failover status of the device.
    failover_status = task.run(
        name="Get failover status", task=f5_bigip_cm_failover_status
    ).result

    # If it's the ACTIVE device, send the declaration and perform a sync.
    if failover_status == "ACTIVE":
        task.run(
            name="AS3 POST",
            task=f5_atc,
            atc_method="POST",
            atc_service="AS3",
            as3_tenant=as3_tenant,
            atc_declaration_file=task.host["appsvcs"][as3_tenant][
                "atc_declaration_file"
            ],
        )

        task.run(
            name="Synchronize the devices",
            task=f5_bigip_cm_sync_config,
            device_group=task.host["device_group"],
        )

        return Result(
            host=task.host,
            result="ACTIVE device, AS3 declaration successfully deployed.",
        )
    # Else, do nothing...
    else:
        return Result(host=task.host, result="STANDBY device, skipped.")

nr = InitNornir(config_file="config.yml")
nr = nr.filter(platform="f5_bigip")

result = nr.run(
    name="POST AS3 Declaration from file",
    task=as3_post,
    as3_tenant="Simple_01",
)

print_result(result)

Plugins

Connections

  • f5: Connect to F5 BIG-IP systems using iControl REST.

Tasks

  • f5_atc: Deploy an F5 Automation Tool Chain (ATC) declaration (only AS3 for now) on a BIG-IP system.
  • f5_bigip_cm_failover_status: Get the failover status of the BIG-IP system.
  • f5_bigip_cm_sync_config: Synchronize the configuration between BIG-IP systems.
  • f5_bigip_cm_sync_status: Get the configuration synchronization status of the BIG-IP system.
  • f5_bigip_shared_file_transfer_upload: Upload a file to a BIG-IP system.
  • f5_bigip_shared_iapp_lx_package: Manage Javascript LX packages on a BIG-IP system.
  • f5_bigip_sys_version: Get software version information for the BIG-IP system.
  • f5_bigip_util_unix_ls: List information about the FILEs or directory content on a BIG-IP system.
  • f5_bigip_util_unix_rm: Delete a file on a BIG-IP system.

Roadmap

  • ATC - Deploy Device (DO) declarations
  • ATC - Deploy Telemetry (TS) declarations
  • Dry-run

Authors

  • Eric Jacob (@erjac77)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nornir_f5-0.1.0.tar.gz (15.5 kB view hashes)

Uploaded Source

Built Distribution

nornir_f5-0.1.0-py3-none-any.whl (19.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page