adding backend template for testing
This commit is contained in:
@@ -27,11 +27,14 @@ define cd_haproxy::server::proxy (
|
||||
|
||||
$frontend_name = undef,
|
||||
$frontend_order = '010',
|
||||
$backend_name = undef,
|
||||
$backend_order = '020',
|
||||
|
||||
) {
|
||||
|
||||
$hy_main_config = '/etc/haproxy/haproxy.cfg'
|
||||
$hy_frontendrule = 'cd_haproxy/haproxy_frontend_rule.erb'
|
||||
$hy_backendrule = 'cd_haproxy/haproxy_backend_rule.erb'
|
||||
|
||||
# create frontend section
|
||||
concat::fragment { "frontend_${name}":
|
||||
@@ -40,4 +43,11 @@ $hy_frontendrule = 'cd_haproxy/haproxy_frontend_rule.erb'
|
||||
order => $frontend_order,
|
||||
}
|
||||
|
||||
# create backend section
|
||||
concat::fragment { "backend_${name}":
|
||||
target => $hy_main_config,
|
||||
content => template($hy_backendrule),
|
||||
order => $backend_order,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ class cd_haproxy::server::proxy_test (
|
||||
) inherits cd_haproxy::params {
|
||||
|
||||
cd_haproxy::server::proxy { 'testing':
|
||||
frontend_name => 'test01',
|
||||
frontend_name => 'test01-frontend',
|
||||
backend_name => 'test01-backend',
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
backend <%= @backend_name %>
|
||||
|
||||
Reference in New Issue
Block a user