iApp - error when creating pools
Hi All
Im trying to build out an iapp that creates a number of duplicate objects with minor differences.
my config so far looks like this
presentation
section members { Build a table of pool members message members table pool_members { editchoice addr display "large" tcl { package require iapp 1.1.3 return [iapp::get_items ltm node] } } }
Implementation
iapp::template start set object_name $tmsh::app_name
tmsh::create "/ltm monitor tcp MON-${object_name}_80 adaptive disabled defaults-from tcp description $object_name interval 5 ip-dscp 0 time-until-up 0 timeout 16" tmsh::create "/ltm monitor tcp MON-${object_name}_443 adaptive disabled defaults-from tcp description $object_name interval 5 ip-dscp 0 time-until-up 0 timeout 16"
set servers $::members__pool_members
I am trying to append the port number as I only want the user to input the node addresses ( there will eventually be +10 of the same pools created but with different ports )
set newlist {} set port :80 foreach item $servers { set newitem $item$port lappend newitem lappend newlist $newitem }
tmsh::create "/ltm pool POOL-${object_name}_80 description ${object_name}_80 members add { $newlist } monitor MON-${object_name}_80"
iapp::template stop
When I run this iapp i get the following error.
script did not successfully complete: (one or more configuration identifiers must be provided while executing "tmsh::create "/ltm pool POOL-${object_name}_80 description ${object_name}_80 members add { $newlist } monitor MON-${object_name}_80"" line:26)
noted that if if set the servers list manually (set servers {1.1.1.1 2.2.2.2}) this all works fine and all objects are created correctly.
Im fairly sure the error has to do with the port number not being appended correctly. But cant see why it wouldnt work when the info is grabbed from presentation rather than inputted manually
Any input appreciated.
Thanks
iapp::pool_members will try to do the right thing based on what you give it. If there is a "port" or "port_secure" column in your table, it will use those port values. You can specify a port value to override those with the -port flag (e.g. iapp::pool_members -port 8080 $::members__pool_members). If you specify only IP addresses and omit the -port flag, it will assume port 80.