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

Connection plugin and various tasks to interact with F5 systems via the iControlREST API.

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_config_sync,
    f5_bigip_cm_failover_status,
)

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_config_sync,
            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 (AS3, DO and TS*) on a BIG-IP system.
  • f5_bigip_cm_config_sync: Synchronize the configuration between BIG-IP systems.
  • f5_bigip_cm_failover_status: Get the failover status of the BIG-IP system.
  • f5_bigip_cm_sync_status: Get the configuration synchronization status of the BIG-IP system.
  • f5_bigip_shared_file_transfer_uploads: 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:
    • *Support Telemetry (TS)
    • Support BIG-IQ
  • Support dry-run mode

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.2.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

nornir_f5-0.2.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nornir_f5-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7cf858a566d714d636efc54f3dc09a018264d4b7130e8c979a1c440b01ea8c32
MD5 c13b6b2b00226da8887d6cf87b2f1d27
BLAKE2b-256 9cbf17d19cf79c9edfdf23dac06bc52c25ecf22546eda2c769dcf9713b882892

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for nornir_f5-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6f7e9114234c827d153f9ce168a60387b30226bad7d1643b7f8ee03ea8cbdde
MD5 8583b929dc772ecc959bdd756958fc8b
BLAKE2b-256 9368e6b972499b54737759d367daf63cd151f2bbb1dca351f76c048de2ad7195

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