Adds bigip_iapp_template module (#25630)

This module can be used to upload and manage TCL iApps on a BIG-IP.
iApps can be added, removed and updated in place as needed. iApp
files should be provided to the module via Ansible lookups.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_iapp_template.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_iapp_template/tasks
This commit is contained in:
Tim Rupp
2017-06-14 10:29:10 -07:00
committed by John R Barker
parent 0c68e200d5
commit 478d364f4d
6 changed files with 802 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
sys application template good_templ {
actions {
definition {
html-help {
# HTML Help for the template
}
implementation {
# TMSH implementation code
}
macro {
# TMSH macro code
}
presentation {
# APL presentation language
}
role-acl { admin manager resource-admin }
run-as none
}
}
description "My basic template"
partition Common
requires-modules { ltm }
ignore-verification true
requires-bigip-version-min 11.6.0
}

View File

@@ -0,0 +1,56 @@
cli admin-partitions {
update-partition Common
}
sys application template foo.iapp {
actions {
definition {
implementation {
set cfg { ltm virtual forwarding-repro {
destination 0.0.0.0:any
description "something 1"
mask any
profiles {
fastL4 { }
}
source 1.1.1.1/32
translate-address disabled
translate-port disabled
vlans { __forwarding_vlans__ }
vlans-enabled
} }
if {![info exists {::var__forwarding_vlans}] || (${::var__forwarding_vlans} == "")} {
set {::var__forwarding_vlans} "{}"
puts "Info: assigning empty string to variable {::var__forwarding_vlans}"
}
set cfg [string map "__forwarding_vlans__ ${::var__forwarding_vlans} __app_service__ $tmsh::app_name.app/$tmsh::app_name " $cfg]
set fileId [open /var/tmp/demo.repro.cfg "w"]
puts -nonewline $fileId $cfg
close $fileId
tmsh::load sys config merge file /var/tmp/demo.repro.cfg
}
presentation {
include "/Common/f5.apl_common"
section var {
string forwarding_vlans display "xxlarge"
}
text {
var "General variables"
var.forwarding_vlans "__var__forwarding_vlans__"
}
}
role-acl { admin manager resource-admin }
}
}
}

View File

@@ -0,0 +1,21 @@
{
"kind": "tm:sys:application:template:templatestate",
"name": "good_templ",
"partition": "Common",
"fullPath": "/Common/good_templ",
"generation": 410,
"selfLink": "https://localhost/mgmt/tm/sys/application/template/~Common~good_templ?ver=13.0.0",
"description": "My basic template",
"ignoreVerification": "false",
"requiresBigipVersionMin": "11.6.0",
"requiresModules": [
"ltm"
],
"tmplChecksum": "90c46acee5ca08e300da0bcdb9130745",
"totalSigningStatus": "checksum",
"verificationStatus": "checksum-verified",
"actionsReference": {
"link": "https://localhost/mgmt/tm/sys/application/template/~Common~good_templ/actions?ver=13.0.0",
"isSubcollection": true
}
}

View File

@@ -0,0 +1,21 @@
{
"kind": "tm:sys:application:template:templatestate",
"name": "good_templ",
"partition": "Common",
"fullPath": "/Common/good_templ",
"generation": 410,
"selfLink": "https://localhost/mgmt/tm/sys/application/template/~Common~good_templ?ver=13.0.0",
"description": "My basic foo bar",
"ignoreVerification": "false",
"requiresBigipVersionMin": "12.0.0",
"requiresModules": [
"ltm"
],
"tmplChecksum": "eee01710dbe330d380d1a4fa30eeabdb",
"totalSigningStatus": "checksum",
"verificationStatus": "checksum-verified",
"actionsReference": {
"link": "https://localhost/mgmt/tm/sys/application/template/~Common~good_templ/actions?ver=13.0.0",
"isSubcollection": true
}
}