Nornir 的 F5 插件
项目描述
nornir_f5
Nornir 插件的集合,用于与 F5 系统交互并将声明部署到 F5 自动化工具链 (ATC) 服务,如 AS3、DO 和 TS。
安装
点
pip install nornir-f5
诗歌
poetry add nornir-f5
用法
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 (
atc,
bigip_cm_config_sync,
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=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="POST AS3 Declaration from file",
task=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=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="AS3 POST",
task=as3_post,
as3_tenant="Simple_01",
)
print_result(result)
插件
连接
- f5:连接到 F5 REST 服务器。
任务
- atc:在 BIG-IP/IQ 系统上部署 ATC 声明。
- atc_info:返回 ATC 服务实例的版本和发布信息。
- bigip_cm_config_sync:同步 BIG-IP 系统之间的配置。
- bigip_cm_failover_status:获取 BIG-IP 系统的故障转移状态。
- bigip_cm_sync_status:获取 BIG-IP 系统的配置同步状态。
- bigip_shared_file_transfer_uploads:将文件上传到 BIG-IP 系统。
- bigip_shared_iapp_lx_package:管理 BIG-IP 系统上的 Javascript LX 包。
- bigip_sys_version:获取 BIG-IP 系统的软件版本信息。
- bigip_util_unix_ls:列出有关 BIG-IP 系统上的文件或目录内容的信息。
- bigip_util_unix_rm:删除 BIG-IP 系统上的文件。
作者
- 埃里克·雅各布 (@erjac77)
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
nornir_f5-0.5.1.tar.gz
(16.5 kB
查看哈希)
内置分布
nornir_f5-0.5.1-py3-none-any.whl
(22.3 kB
查看哈希)
关
nornir_f5-0.5.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | eca6d9d7bfa4a580ad9cb6c2e5d5d4fab6cbcb6de599d2e71c36e2e91aadc7f4 |
|
MD5 | 86cb8b5a351b366276bc114be54a3c6e |
|
布莱克2-256 | ab1aa23b2f4d208ab8b0a0e15ebe94b12f499920221403088dee50f11c718f3b |
关
nornir_f5-0.5.1 -py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 879830484cc2b690f314ecfd3e60ea2eef1c156a91f3d73fd1b15ad8e421c483 |
|
MD5 | e0e13271847993eb0488dc589d1a228a |
|
布莱克2-256 | 268fb592fa2300b07c77dc777355da596af6bff33f4db4c2ca74f551641def4c |