mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Refactors irule module to conform to recent standards (#25709)
Also includes unit tests for the code
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
when LB_SELECTED {
|
||||
# Capture IP address chosen by WIP load balancing
|
||||
set wipHost [LB::server addr]
|
||||
}
|
||||
|
||||
when LB_FAILED {
|
||||
set wipHost [LB::server addr]
|
||||
}
|
||||
18
test/units/modules/network/f5/fixtures/create_ltm_irule.tcl
Normal file
18
test/units/modules/network/f5/fixtures/create_ltm_irule.tcl
Normal file
@@ -0,0 +1,18 @@
|
||||
when RULE_INIT {
|
||||
set static::FormBaseURL "/sp-ofba-form"
|
||||
set static::FormReturnURL "/sp-ofba-completed"
|
||||
set static::HeadAuthReq "X-FORMS_BASED_AUTH_REQUIRED"
|
||||
set static::HeadAuthRet "X-FORMS_BASED_AUTH_RETURN_URL"
|
||||
set static::HeadAuthSize "X-FORMS_BASED_AUTH_DIALOG_SIZE"
|
||||
set static::HeadAuthSizeVal "800x600"
|
||||
set static::ckname "MRHSession_SP"
|
||||
set static::Basic_Realm_Text "SharePoint Authentication"
|
||||
}
|
||||
|
||||
when HTTP_REQUEST {
|
||||
set apmsessionid [HTTP::cookie value MRHSession]
|
||||
}
|
||||
|
||||
when HTTP_RESPONSE {
|
||||
# Insert persistent cookie for html content type and private session
|
||||
}
|
||||
20
test/units/modules/network/f5/fixtures/load_gtm_irules.json
Normal file
20
test/units/modules/network/f5/fixtures/load_gtm_irules.json
Normal file
@@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"kind": "tm:gtm:rule:rulestate",
|
||||
"name": "asdf",
|
||||
"partition": "Common",
|
||||
"fullPath": "/Common/asdf",
|
||||
"generation": 92,
|
||||
"selfLink": "https://localhost/mgmt/tm/gtm/rule/~Common~asdf?ver=12.1.2",
|
||||
"apiAnonymous": "when DNS_REQUEST {\n if { [IP::addr [IP::remote_addr] equals 10.254.254.0/24] } {\n cname test.affilate.example.com\n\n } elseif { [IP::addr [IP::remote_addr] equals 10.0.0.0/8] } {\n cname test.internal.example.com\n\n }\n #everything else will be handled by the default pools in the main WIP\n}"
|
||||
},
|
||||
{
|
||||
"kind": "tm:gtm:rule:rulestate",
|
||||
"name": "foo",
|
||||
"partition": "Common",
|
||||
"fullPath": "/Common/foo",
|
||||
"generation": 93,
|
||||
"selfLink": "https://localhost/mgmt/tm/gtm/rule/~Common~foo?ver=12.1.2",
|
||||
"apiAnonymous": "when LB_SELECTED {\n # Capture IP address chosen by WIP load balancing\n set wipHost [LB::server addr]\n}\n\nwhen LB_FAILED {\n set wipHost [LB::server addr]\n}"
|
||||
}
|
||||
]
|
||||
179
test/units/modules/network/f5/fixtures/load_ltm_irules.json
Normal file
179
test/units/modules/network/f5/fixtures/load_ltm_irules.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user