diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2010-04-27 13:45:16 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2010-04-27 13:45:16 -0400 |
commit | 7ca4dcd8af8902da674135860d5ae9345be8391e (patch) | |
tree | d9e719446aa4c0ba89d69db43e759626307ff768 | |
parent | 101cc0b648900b72ae4b85f1b6ba8378673bf2cb (diff) | |
download | pfsense-packages-7ca4dcd8af8902da674135860d5ae9345be8391e.tar.gz pfsense-packages-7ca4dcd8af8902da674135860d5ae9345be8391e.tar.bz2 pfsense-packages-7ca4dcd8af8902da674135860d5ae9345be8391e.zip |
Add backend weight for LB director
-rw-r--r-- | config/varnish64/varnish.inc | 9 | ||||
-rw-r--r-- | config/varnish64/varnish_lb_directors.xml | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc index d21245d8..026f602c 100644 --- a/config/varnish64/varnish.inc +++ b/config/varnish64/varnish.inc @@ -197,8 +197,13 @@ EOFA; foreach($config['installedpackages']['varnishlbdirectors']['config'] as $backend) { $director = ""; if($backend['row']) - foreach($backend['row'] as $be) - $director .= "\t{\n\t\t.backend = {$be['backendname']};\n\t}"; + foreach($backend['row'] as $be) { + if($be['weight']) + $weight = "\n\t\t\t.weight = {$be['weight']};\n" + else + $weight = ""; + $director .= "\t{\n\t\t.backend = {$be['backendname']};\n{$weight}\t}"; + } $backends .= <<<EOFA director {$backend['directorname']} {$backend['directortype']} { {$director} diff --git a/config/varnish64/varnish_lb_directors.xml b/config/varnish64/varnish_lb_directors.xml index d67327fa..454d8768 100644 --- a/config/varnish64/varnish_lb_directors.xml +++ b/config/varnish64/varnish_lb_directors.xml @@ -134,6 +134,12 @@ <source_value>backendname</source_value> <type>select_source</type> </rowhelperfield> + <rowhelperfield> + <fielddescr>Weight</fielddescr> + <fieldname>weight</fieldname> + <description>Enter the weight of this backend.</description> + <type>input</type> + </rowhelperfield> </rowhelper> </field> </fields> |