iApp Lab 4 - Simplify an iApp Template¶
This template has too many questions!¶
Sometimes a customer knows that the answers to a number of the
questions in a template will always be the same in their environment.
They may wish to remove those options so as to not create unnecessary
confusion and potential for error. In this lab, you are going to take
the f5.microsoft_sharepoint_2010 iApp template and simplify it by
removing questions and hard-coding the answers to those questions on
the back-end. In this particular case, the imaginary customer in
question is happy with the sharepoint template, but they want to lock
some things down. Specifically,
1. They want to always use the specific SSL profile for their
organization.
2. They have an advanced SharePoint monitor that they want to always
be applied to pools.
3. They know that their clients will always be connecting over the
WAN.
4. They always want to use Web Accelerator.
Note: When it comes to editing your template, you have a choice as to
how you want to do it.
1. You can edit the template on the BIG-IP in TMSH, using vi.
2. You can export the entire template as a file, load that file into
your code editor for editing, and then import it back into the BIG-IP
when you are finished.
3. You can cut-and-paste the contents of the section that you are
working on into the code editor of your choice, work on it there, and
cut-and-paste it back.
4. You can make your edits in the BIG-IP iApp Template UI, although
this option is really not recommended.
Part 1: Copy the iApp template¶
1. Navigate to the iApp -> Templates screen.
2. Select the f5. microsoft_sharepoint_2010 template to view it.
3. Scroll down to the bottom of the screen and click the Copy button.
4. Name your new template and save it.
Part 2: Edit the Presentation Section¶
The following is a series of tasks that need to be accomplished. If
you are uncertain how to complete a task, you can look for examples of
similar things being done in other templates.
1. Remove the SSL Encryption Questions section.
2. Remove the monitor questions from the Server Pools section
3. Remove the question about if the client wants to connect over LAN
or WAN.
4. Change the default value for the question about if WA should be
enabled to yes instead of no.
5. Don’t forget to remove the entries in the text section that
correspond to the things that you removed from the template.
Part 3: Testing the Presentation¶
It is a really good idea to always make sure that the presentation
part of the template is working the way that you want before you dive
into the implementation section.
1. Enter the template and verify that all of the visual elements,
questions, and labels all look as they should.
2. If anything isn’t right, go back and fix it.
Part 4: Edit the Implementation Section¶
The following is a series of tasks that need to be accomplished. If
you are uncertain how to complete a task, you can look for examples of
similar things being done in other templates.
1. Remove the code that checks if the user wants to offload SSL and
gathers the answers. Instead just add the name of a specific SSL
profile to the list of profiles. For simplicity’s sake, just use the
base clientssl profile for this example.
2. Find every place where the missing offload SSL variable is located.
It doesn’t exist anymore, but if it did, the answer would always be
yes. Replace the if statements with the contents of the part that
would execute when the variable is equal to “Yes”.
3. Remove the section that gathers the monitor answers. Instead just
hard-code the monitor name. For simplicity’s sake, just use the base
http monitor for this example.
4. There are two places where the answer to the LAN or WAN question is
referenced. Replace those references with the WAN answer.
5. Clean up after yourself. Remove any code that will now never be
reached because of your changes.
Part 5: Edit the Help Section¶
Go into the Help section and remove the guidance for the template
features that you removed.
Part 6: Testing the Template as a Whole¶
1. Enter the template and verify that all of the visual elements,
questions, and labels look as they should.
2. Make sure that the template still works as expected.
3. Check the config to make sure that the SSL profile and monitor have
been correctly applied.
4. Make sure that the help section looks right.
Solution Attached Below¶
The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.