So, this was quite the challenge; I spent some time looking into how to accomplish this task, and it's not straight-forward.
The command used to generate the pool members syntax is:
[iapp::pool_members $::pool__members]]
in the
Implementation
section of the iApp.
pool__members
is a table generated by the
Presentation
section of the iApp.
iapp::pool_members
is a tcl procedure (similar to a python function) called from the
iapp 1.0.3
package.
The
iapp::pool_members
procedure is written in a way that does not account for the syntax required to add
fqdn { autopopulate enabled }
.
So this solution requires modifying several steps:
- Update the presentation template to include an 'autopopulate' option.
- Update Update the iapp utility package to read the variable created by autopopulate and write-out the appropriate pool member syntax.
Let's Begin
-
Copy the Presentation, Implementation and HTML Help templates from the default iApp to your favorite text editor:
TMUI -> iApps -> Templates ->
-
Update the Presentation Template in the following ways:
a. Update the pool members table and add
choice autopopulate
.
...
table members {
optional (( ssl_encryption_questions.legacy_advanced == "yes"
|| ssl_encryption_questions.advanced == "yes" )
&& use_pga == "yes" ) {
string priority default "0" required
validator "NonNegativeNumber" display "small"
}
choice autopopulate <<<--------< Add this line
}
optional ( ssl_encryption_questions.help == "max" ) {
message members_max
}
...
b. In the 'Text' section, add
pool.members.autopopulate
section which will provide a 'None, Yes, No' set of options in TMUI when creating the pool member(s).
...
pool.members.port_secure "Port"
pool.members.autopopulate "Autopopulate" { <<<--------< Add these lines
"None" => "", <<<--------< Add these lines
"Yes" => "enabled", <<<--------< Add these lines
"No" => "disabled" <<<--------< Add these lines
} <<<--------< Add these lines
pool.members.connection_limit "Connection limit"
...
-
Remount /usr as Read-Write (rw) so we can make changes.
mount -o remount,rw /usr
-
Create a copy of the iapp.1.3.0.tcl package so we can customize it without modifying the original:
cp /usr/share/tcl8.5/iapp/iapp.1.3.0.tcl /usr/share/tcl8.5/iapp/iapp.1.3.0.1.tcl
-
Update the new package so it knows it provides iapp 1.3.0.1 package.
sed -i 's/package provide iapp 1.3.0/package provide iapp 1.3.0.1/g' /usr/share/tcl8.5/iapp/iapp.1.3.0.1.tcl
-
Tell scriptd that the new package exists by adding an entry to /usr/share/tcl8.5/iapp/pkgIndex.tcl
echo 'package ifneeded iapp 1.3.0.1 [list source [file join $dir iapp.1.3.0.1.tcl]]' >> /usr/share/tcl8.5/iapp/pkgIndex.tcl
-
Change to /usr/share/compat-tcl8.4/iapp/ directory and add a new symlink:
cd /usr/share/compat-tcl8.4/iapp/
ln -s /usr/share/tcl8.5/iapp/iapp.1.3.0.1.tcl iapp.1.3.0.1.tcl
-
Edit /usr/share/tcl8.5/iapp/iapp.1.3.0.1.tcl to account for the new
pool.members.autopopulate
property (Step 2):
vim /usr/share/tcl8.5/iapp/iapp.1.3.0.1.tcl
a. Add
fqdn autopopulate
to the fields
array:
proc ::iapp::pool_members { args } {
Set defaults.
array set fields {
address addr
port port
port-secure port_secure
connection-limit connection_limit
priority-group priority
ratio ratio
fqdn autopopulate <<<--------< Add this line
}
b. Update this foreach loop:
FROM:
Transfer non-port fields from the table to the tmsh string.
foreach name $nonport_fields {
if { [info exists columns($fields($name))] } {
append members " $name $columns($fields($name))"
}
}
TO:
Transfer non-port fields from the table to the tmsh string.
foreach name $nonport_fields {
if { [info exists columns($fields($name))] } {
if { $name == "fqdn" } {
if { $columns($fields($name)) != "" } {
append members " fqdn \{ autopopulate $columns($fields($name)) \}"
}
} else {
append members " $name $columns($fields($name))"
}
}
}
-
Exit the text editor (:wq) and remount /usr as Read-Only (ro)
mount -o remount,ro /usr
-
In the Presentation Template and Implementation Template, make the following changes:
NOTE: There are over 50 references; make sure you get them all; I suggest a search/replace function in your text editor.
FROM:
package require iapp 1.3.0
TO:
package require iapp 1.3.0.1
-
Create a new, custom iApp Template using the modified Implementation and Presentation templates and the unmodified HTML Help section:
- TMUI -> iApps -> Templates -> Templates ->
click
'Create' - Provide a name for your new template.
- Minimum BIG-IP Version == 11.5.0
- Copy the 'Implementation Template',
Modified
'Presentation Template', and 'HTML Help' section into the appropriate - Click 'save'
-
Deploy a new iApp using the customized template.
TMUI -> iApps -> Application Services -> Applications ->
click
'Create'
NOTE: The FQDN 'ltm node' object must have already been created with 'fqdn { autopopulate enabled }', otherwise you will observe the following error:
01070734:3: Configuration error: Cannot enable pool member to autopopulate: node (/Common/example.com) has autopopulate set to disabled.