diff --git a/manifests/server/proxy.pp b/manifests/server/proxy.pp index e60f63f..9a813a2 100644 --- a/manifests/server/proxy.pp +++ b/manifests/server/proxy.pp @@ -27,14 +27,17 @@ define cd_haproxy::server::proxy ( $frontend_name = undef, $frontend_order = '010', +$acl_rule = undef, +$acl_order = '20', $backend_name = undef, -$backend_order = '020', +$backend_order = '030', ) { $hy_main_config = '/etc/haproxy/haproxy.cfg' $hy_frontendrule = 'cd_haproxy/haproxy_frontend_rule.erb' $hy_backendrule = 'cd_haproxy/haproxy_backend_rule.erb' +$hy_acl_rule = 'cd_haproxy/haproxy_acl_rule.erb' # create frontend section concat::fragment { "frontend_${name}": @@ -43,11 +46,16 @@ $hy_backendrule = 'cd_haproxy/haproxy_backend_rule.erb' order => $frontend_order, } + # create acl section + concat::fragment { "acl_${name}": + target => $hy_main_config, + content => template($hy_acl_rule), + } + # create backend section concat::fragment { "backend_${name}": target => $hy_main_config, content => template($hy_backendrule), order => $backend_order, } - } diff --git a/manifests/server/proxy_test.pp b/manifests/server/proxy_test.pp index c647c3d..5b00659 100644 --- a/manifests/server/proxy_test.pp +++ b/manifests/server/proxy_test.pp @@ -26,7 +26,7 @@ class cd_haproxy::server::proxy_test ( cd_haproxy::server::proxy { 'testing': frontend_name => 'test01-frontend', + acl_rule => 'test01-acl', backend_name => 'test01-backend', } - } diff --git a/templates/haproxy_acl_rule.erb b/templates/haproxy_acl_rule.erb index e69de29..8cf0d69 100644 --- a/templates/haproxy_acl_rule.erb +++ b/templates/haproxy_acl_rule.erb @@ -0,0 +1,2 @@ + +acl <%= @acl_rule %>