Forum Discussion
Ed_Carpon_13196
Feb 14, 2014Nimbostratus
Local Traffic Policies in an iApp
To assign a local traffic policy to a virtual server you have to disable strictness which we do not want to do. Has anyone created an iApp template that would give you the ability to select policies...
- Feb 21, 2014
I had to fiddle around with a copy of the iApp to get it working.
I think you were missing a close curly bracket in your multichoice in the presentation section.
I did this with the f5.http template, but it should be similar for any iApp (profiles assignment has to come first if your traffic policy requires any profiles added by the iApp):
virtual server array in implementation array set vs_arr { 1,1 { [iapp::conf create ltm virtual ${app}_vs \ destination [iapp::destination $::pool__addr $::pool__port_secure] \ mask $mask \ $vs_params \ ip-protocol tcp \ mirror $mirror_action \ profiles replace-all-with \{ $vs_profiles \} \ policies replace-all-with \{ $::policies__policies\}] \ \ [iapp::conf create ltm virtual ${app}_redir_vs \ destination [iapp::destination $::pool__addr [expr {[info exists \ ::pool__redirect_port] ? $::pool__redirect_port : 80}]] \ mask $mask \ $redir_vs_params \ ip-protocol tcp \ mirror $mirror_action \ profiles replace-all-with \{ $tcp_profiles http \} \ rules \{ [iapp::substa redirect_irule($::pool__port_secure)] \}]} 1,0 { [iapp::conf create ltm virtual ${app}_vs \ destination [iapp::destination $::pool__addr $::pool__port_secure] \ mask $mask \ $vs_params \ ip-protocol tcp \ mirror $mirror_action \ profiles replace-all-with \{ $vs_profiles \} \ policies replace-all-with \{ $::policies__policies\}] \ } * { [iapp::conf create ltm virtual ${app}_vs \ destination [iapp::destination $::pool__addr $::pool__port] \ mask $mask \ $vs_params \ ip-protocol tcp \ mirror $mirror_action \ profiles replace-all-with \{ $vs_profiles \} \ policies replace-all-with \{ $::policies__policies\}] \ } } policies section in presentation section policies { multichoice policies tcl { set objs [tmsh::get_config ltm policy] foreach obj $objs { append results [tmsh::get_name $obj] append results "\n" } return $results } } questions for policy section in presentation policies "Local Traffic Policies" policies.policies "Select the Local Traffic Policies you like to attach to the BIG- IP Virtual Server:"
mikeshimkus_111
Historic F5 Account
Ed, for some reason your last post here got lost, although I did get it in my email.
I think this might work:
array set vs_arr {
1,1 { [iapp::conf create ltm virtual ${app}_vs \
destination [iapp::destination $::pool__addr $::pool__port_secure] \
mask $mask \
$vs_params \
ip-protocol tcp \
mirror $mirror_action \
policies replace-all-with \{ $::policies__policies\}] \
profiles replace-all-with \{ $vs_profiles \}] \
\
[iapp::conf create ltm virtual ${app}_redir_vs \
destination [iapp::destination $::pool__addr [expr {[info exists \
::pool__redirect_port] ? $::pool__redirect_port : 80}]] \
mask $mask \
$redir_vs_params \
ip-protocol tcp \
mirror $mirror_action \
profiles replace-all-with \{ $redir_vs_profiles \} \
rules \{ [iapp::substa redirect_irule($::pool__port_secure)] \}]}
1,0 { [iapp::conf create ltm virtual ${app}_vs \
destination [iapp::destination $::pool__addr $::pool__port_secure] \
mask $mask \
$vs_params \
ip-protocol tcp \
mirror $mirror_action \
policies replace-all-with \{ $::policies__policies\}] \
profiles replace-all-with \{ $vs_profiles \}] }
* { [iapp::conf create ltm virtual ${app}_vs \
destination [iapp::destination $::pool__addr $::pool__port] \
mask $mask \
$vs_params \
ip-protocol tcp \
mirror $mirror_action \
policies replace-all-with \{ $::policies__policies\}] \
profiles replace-all-with \{ $vs_profiles \}] }
}
mikeshimkus_111
Feb 18, 2014Historic F5 Account
I wouldn't replace the entire array. You should just insert the "policies replace-all-with \{ $::policies__policies\}] \" parameter.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects