adds acl rule for testing
This commit is contained in:
@@ -27,14 +27,17 @@ define cd_haproxy::server::proxy (
|
|||||||
|
|
||||||
$frontend_name = undef,
|
$frontend_name = undef,
|
||||||
$frontend_order = '010',
|
$frontend_order = '010',
|
||||||
|
$acl_rule = undef,
|
||||||
|
$acl_order = '20',
|
||||||
$backend_name = undef,
|
$backend_name = undef,
|
||||||
$backend_order = '020',
|
$backend_order = '030',
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$hy_main_config = '/etc/haproxy/haproxy.cfg'
|
$hy_main_config = '/etc/haproxy/haproxy.cfg'
|
||||||
$hy_frontendrule = 'cd_haproxy/haproxy_frontend_rule.erb'
|
$hy_frontendrule = 'cd_haproxy/haproxy_frontend_rule.erb'
|
||||||
$hy_backendrule = 'cd_haproxy/haproxy_backend_rule.erb'
|
$hy_backendrule = 'cd_haproxy/haproxy_backend_rule.erb'
|
||||||
|
$hy_acl_rule = 'cd_haproxy/haproxy_acl_rule.erb'
|
||||||
|
|
||||||
# create frontend section
|
# create frontend section
|
||||||
concat::fragment { "frontend_${name}":
|
concat::fragment { "frontend_${name}":
|
||||||
@@ -43,11 +46,16 @@ $hy_backendrule = 'cd_haproxy/haproxy_backend_rule.erb'
|
|||||||
order => $frontend_order,
|
order => $frontend_order,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# create acl section
|
||||||
|
concat::fragment { "acl_${name}":
|
||||||
|
target => $hy_main_config,
|
||||||
|
content => template($hy_acl_rule),
|
||||||
|
}
|
||||||
|
|
||||||
# create backend section
|
# create backend section
|
||||||
concat::fragment { "backend_${name}":
|
concat::fragment { "backend_${name}":
|
||||||
target => $hy_main_config,
|
target => $hy_main_config,
|
||||||
content => template($hy_backendrule),
|
content => template($hy_backendrule),
|
||||||
order => $backend_order,
|
order => $backend_order,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class cd_haproxy::server::proxy_test (
|
|||||||
|
|
||||||
cd_haproxy::server::proxy { 'testing':
|
cd_haproxy::server::proxy { 'testing':
|
||||||
frontend_name => 'test01-frontend',
|
frontend_name => 'test01-frontend',
|
||||||
|
acl_rule => 'test01-acl',
|
||||||
backend_name => 'test01-backend',
|
backend_name => 'test01-backend',
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
acl <%= @acl_rule %>
|
||||||
|
|||||||
Reference in New Issue
Block a user