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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file nornir_f5-0.1.0.tar.gz.

File metadata

  • Download URL: nornir_f5-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for nornir_f5-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f48394de52a2a8f5ff34e54c8cf3befe26a1b26ff8e966a199baabb69123fb1
MD5 bf61ffeca803d54be0eccde01e78ece6
BLAKE2b-256 37d628b75b6751f735a2091d17109283f1c5d78a113bda3802d55d59ffd868ab

See more details on using hashes here.

Provenance

File details

Details for the file nornir_f5-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nornir_f5-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for nornir_f5-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c27c8417c75cb2a601c8085be64a42c40a942928429d1ed949e80aa9cf3fc8b
MD5 56ea2d647b0c8ea26cf462a7f1c114d9
BLAKE2b-256 575b81f9f22bd8109127a07c4f66e5793c5c4b423be811721a8734a8a3bc5518

See more details on using hashes here.

Provenance

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