diff --git a/manifests/xrootd.pp b/manifests/xrootd.pp index 453014ef..2b1d5f98 100644 --- a/manifests/xrootd.pp +++ b/manifests/xrootd.pp @@ -2,6 +2,7 @@ class sunet::xrootd( Array[Hash] $cms_allow_hosts, Array $managers, + String $manager_domain, String $cms_port = '1213', String $container_image = 'docker.sunet.se/staas/xrootd-s3-http', String $container_tag = '0.17.0-1', diff --git a/templates/xrootd/docker-compose.erb.yml b/templates/xrootd/docker-compose.erb.yml index 0de1e847..da930d43 100644 --- a/templates/xrootd/docker-compose.erb.yml +++ b/templates/xrootd/docker-compose.erb.yml @@ -3,11 +3,16 @@ services: image: <%= @container_image %>:<%= @container_tag %> dns: - 89.32.32.32 - hostname: <%= @hostname %> + hostname: <%= @hostname.split('.')[0] %> + network_mode: host extra_hosts: <%- @cms_allow_hosts.each do |extra_host| -%> - "<%= extra_host['name'] %>:<%= extra_host['ipv4'] %>" - "<%= extra_host['name'] %>:<%= extra_host['ipv6'] %>" + <%- if @managers.include?(extra_host['name']) -%> + - "<%= extra_host['name'].split('.')[0] %>:<%= extra_host['ipv4'] %>" + - "<%= extra_host['name'].split('.')[0] %>:<%= extra_host['ipv6'] %>" + <%- end -%> <%- end -%> volumes: - /opt/xrootd/config:/etc/xrootd:ro @@ -21,11 +26,16 @@ services: image: <%= @container_image %>:<%= @container_tag %> dns: - 89.32.32.32 - hostname: <%= @hostname %> + hostname: <%= @hostname.split('.')[0] %> + network_mode: host extra_hosts: <%- @cms_allow_hosts.each do |extra_host| -%> - "<%= extra_host['name'] %>:<%= extra_host['ipv4'] %>" - "<%= extra_host['name'] %>:<%= extra_host['ipv6'] %>" + <%- if @managers.include?(extra_host['name']) -%> + - "<%= extra_host['name'].split('.')[0] %>:<%= extra_host['ipv4'] %>" + - "<%= extra_host['name'].split('.')[0] %>:<%= extra_host['ipv6'] %>" + <%- end -%> <%- end -%> volumes: - /opt/xrootd/config:/etc/xrootd:ro diff --git a/templates/xrootd/xrootd-manager.cfg.erb b/templates/xrootd/xrootd-manager.cfg.erb index 4808b92a..9219843e 100644 --- a/templates/xrootd/xrootd-manager.cfg.erb +++ b/templates/xrootd/xrootd-manager.cfg.erb @@ -17,14 +17,12 @@ all.export <%= @export %> # Set the role to either proxy manager or proxy server all.adminpath <%= @xrootd_admin_path %> all.pidpath <%= @xrootd_admin_path %> -<% @managers.each do |manager| -%> -all.manager <%= manager %>:<%= @xrootd_port %> -<% end -%> +all.manager all <%= @manager_domain %>+ <%= @xrootd_port %> all.role manager # Tell the cmsd which machines are allowed to connects <% @cms_allow_hosts.each do |host| -%> -cms.allow host <%= host %> +cms.allow host <%= host['name'] %> <% end -%> cms.dfs limit 0 lookup distrib mdhold 0 redirect verify retries 2 diff --git a/templates/xrootd/xrootd-server.cfg.erb b/templates/xrootd/xrootd-server.cfg.erb index 9ea9fa41..5d4f6eff 100644 --- a/templates/xrootd/xrootd-server.cfg.erb +++ b/templates/xrootd/xrootd-server.cfg.erb @@ -17,9 +17,7 @@ all.export <%= @export %> # Set the role to either proxy manager or proxy server all.adminpath <%= @xrootd_admin_path %> all.pidpath <%= @xrootd_admin_path %> -<% @managers.each do |manager| -%> -all.manager <%= manager %>:<%= @xrootd_port %> -<% end -%> +all.manager all <%= @manager_domain %>+ <%= @xrootd_port %> all.role server # Tell the cmsd which machines are allowed to connects