Forum Discussion

bigben932_22424's avatar
bigben932_22424
Icon for Altostratus rankAltostratus
Jan 29, 2016

iApp Template file using an Administrative Partition and not Common

I have a template file for my iApp that is not working properly. When my iApp and template are in an Administrative partition, the F5 adds some lines of code to the template file which cause it to not work properly.

 

Let me explain further.

 

The beginning of my template file I have added:

 

cli admin-partitions { 
update-partition Partition1 
} 

sys application template /Parititon1/iAppVersion1 { 
actions { 
definition { 
html-help { 

2 Replies

  • Fred_Slater_856's avatar
    Fred_Slater_856
    Historic F5 Account

    The html files that you refer to may or may not be relevant. The template definition is stored in /config/bigip_script.conf, and the template 'import' button performs the equivalent of a 'tmsh load sys config file merge' with whatever is in the uploaded text file. When you create a template from a non-Common partition, 'update-partition Common' is prepended ahead of 'update-partition Partition1'. It may be superfluous, but it is harmless. Setting aside that technicality, in my tests, config shows in both UI and TMSH that the template is correctly in the administrative partition, even after export/change name/import. Do you see a different behavior on your BIG-IP? What is your end goal?

     

  • Ahh thanks for the info Fred. I have found our issue. It appears that an old template file was being used. I took a look at the new template file, and compared it to an older working version I had backed up and noticed where our issue was. I implemented the changes, and notified our development staff to use this new template file.

     

    Let me post snippet the code which solves this issue:

     

    Old:

     

    proc move_files_to_apm {xml_file html_file} {

     

    set fh [open my_script w]
    puts $fh "
     Moving configuration file and html template to the APM:
    tmsh modify apm resource sandbox hosted-content { files add {\
        $xml_file { folder /AppletInstall local-path /var/tmp/$xml_file }}} 2>/dev/null
    inl_errno=\$?
    echo \"call 1:\$inl_errno\"
    if \[ \$inl_errno -ne 0 \]; then
        tmsh modify apm resource sandbox hosted-content { files modify {\
        $xml_file { folder /AppletInstall local-path /var/tmp/$xml_file }}}
        inl_errno=\$?
        echo \"call 1a:\$inl_errno\"
        if \[ \$inl_errno -ne 0 \]; then
            exit \$inl_errno
        fi
    fi

    New: proc move_files_to_apm {xml_file html_file} {

     

    set fh [open my_script w]
    
    set partition [lindex [split [tmsh::pwd] /] 1]
    adding this parameter and using the variable in the tmsh modify apm.... Solved our problem
    
    puts $fh "
     Moving configuration file and html template to the APM:
    tmsh modify apm resource sandbox /$partition/hosted-content { files add {\
        $xml_file { folder /AppletInstall local-path /var/tmp/$xml_file }}} 2>/dev/null
    inl_errno=\$?
    echo \"call 1:\$inl_errno\"
    if \[ \$inl_errno -ne 0 \]; then
        tmsh modify apm resource sandbox /$partition/hosted-content { files modify {\
        $xml_file { folder /AppletInstall local-path /var/tmp/$xml_file }}}
        inl_errno=\$?
        echo \"call 1a:\$inl_errno\"
        if \[ \$inl_errno -ne 0 \]; then
            exit \$inl_errno
        fi
    fi

    Thank for the help Fred.