Forum Discussion
atatps_250754
Mar 16, 2017Altocumulus
iRule breaking iApp Template?
Gents,
Armed with this how-to article on DevCentral, I built an iApp template to automate app creation. However, the template only deploys properly when the iRule section is omitted otherwise it wi...
- Mar 24, 2017
Was able to get help from Support. The solution, contrary to the article, was to remove the backslashes so it should be:
tmsh::create { ltm rule IAPPTEST-Homepage-http when HTTP_REQUEST { if { [string tolower [HTTP::path]] starts_with "/homepage"}{ pool IAPPTEST-ebiz-http member 10.1.10.101 } else { pool IAPPTEST-ebiz-http } } }
As opposed to:
tmsh::create { ltm rule IAPPTEST-Homepage-http when HTTP_REQUEST { if { \[string tolower \[HTTP::path\]\] starts_with \"/homepage/\" } { pool IAPPTEST-ebiz-http member 10.1.10.101 } else { pool IAPPTEST-ebiz-http } } }
atatps_250754
Mar 17, 2017Altocumulus
Here's the full template if that helps:
tmsh::create {
ltm node 10.1.10.101
address 10.1.10.101
}
tmsh::create {
ltm node 10.1.10.102
address 10.1.10.102
}
tmsh::create {
ltm node 10.1.10.103
address 10.1.10.103
}
tmsh::create {
ltm node 10.1.10.104
address 10.1.10.104
}
tmsh::create {
ltm node 10.1.10.105
address 10.1.10.105
}
tmsh::create {
ltm node 10.1.10.106
address 10.1.10.106
}
tmsh::create {
ltm pool IAPPTEST-app
members replace-all-with {
10.1.10.104:9001 {
address 10.1.10.104
}
10.1.10.105:9001 {
address 10.1.10.105
}
}
monitor tcp
}
tmsh::create {
ltm pool IAPPTEST-boe
members replace-all-with {
10.1.10.106:8080 {
address 10.1.10.106
}
}
}
tmsh::create {
ltm pool IAPPTEST-ebiz-http
members replace-all-with {
10.1.10.101:80 {
address 10.1.10.101
}
10.1.10.102:80 {
address 10.1.10.102
}
10.1.10.103:80 {
address 10.1.10.103
}
}
monitor http
}
tmsh::create {
ltm pool IAPPTEST-ebiz-https
members replace-all-with {
10.1.10.101:443 {
address 10.1.10.101
}
10.1.10.102:443 {
address 10.1.10.102
}
10.1.10.103:443 {
address 10.1.10.103
}
}
monitor https
}
tmsh::create {
ltm rule IAPPTEST-Homepage-http
when HTTP_REQUEST {
if { \[string tolower \[HTTP::path\]\] starts_with \"/homepage/\" } {
pool IAPPTEST-ebiz-http member 10.1.10.101
} else {
pool IAPPTEST-ebiz-http
}
}
}
tmsh::create {
ltm rule IAPPTEST-Homepage-https
when HTTP_REQUEST {
if { \[string tolower \[HTTP::path\]\] starts_with \"/homepage/\" } {
pool IAPPTEST-ebiz-https member 10.1.10.101
} else {
pool IAPPTEST-ebiz-https
}
}
}
tmsh::create {
ltm virtual IAPPTEST-app
destination 10.100.100.100:9001
ip-protocol tcp
mask 255.255.255.255
pool IAPPTEST-app
profiles replace-all-with {
fastL4 { }
}
source 0.0.0.0/0
source-address-translation {
type automap
}
translate-address enabled
translate-port enabled
}
tmsh::create {
ltm virtual IAPPTEST-boe
destination 10.100.100.100:8080
ip-protocol tcp
mask 255.255.255.255
pool IAPPTEST-boe
profiles replace-all-with {
fastL4 { }
}
source 0.0.0.0/0
source-address-translation {
type automap
}
translate-address enabled
translate-port enabled
}
tmsh::create {
ltm virtual IAPPTEST-ebiz-http
destination 10.100.100.100:80
ip-protocol tcp
mask 255.255.255.255
pool IAPPTEST-ebiz-http
profiles replace-all-with {
http-with-xforward { }
tcp { }
}
rules {
IAPPTEST-Homepage-http
}
source 0.0.0.0/0
source-address-translation {
type automap
}
translate-address enabled
translate-port enabled
}
tmsh::create {
ltm virtual IAPPTEST-ebiz-https
destination 10.100.100.100:443
ip-protocol tcp
mask 255.255.255.255
pool IAPPTEST-ebiz-https
profiles replace-all-with {
http-with-xforward { }
tcp-lan-optimized {
context serverside
}
tcp-mobile-optimized {
context clientside
}
}
rules {
IAPPTEST-Homepage-https
}
source 0.0.0.0/0
source-address-translation {
type automap
}
translate-address enabled
translate-port enabled
}
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