Forum Discussion

Ed_Carpon_13196's avatar
Ed_Carpon_13196
Icon for Nimbostratus rankNimbostratus
Feb 14, 2014
Solved

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...
  • mikeshimkus_111's avatar
    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:"