From 19532076efb434f0c4105c01beb88883937871d3 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sat, 16 Nov 2024 16:43:40 +0100 Subject: [PATCH] change shape and name of buckets --- manifests/xrootd.pp | 5 ++--- templates/xrootd/xrootd.cfg.erb | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/manifests/xrootd.pp b/manifests/xrootd.pp index 8ca99650..133a21f8 100644 --- a/manifests/xrootd.pp +++ b/manifests/xrootd.pp @@ -2,7 +2,6 @@ class sunet::xrootd( Array $cms_allow_hosts, Array $managers, - String $environment, String $cms_port = '1213', String $container_image = 'docker.sunet.se/staas/xrootd-s3-http', String $container_tag = '0.17.0-1', @@ -14,7 +13,7 @@ $hostname = $facts['networking']['fqdn'] # Config - $config = lookup($environment) + $xrootd_buckets = lookup('xrootd_buckets') # Composefile sunet::docker_compose { 'xrootd': @@ -41,7 +40,7 @@ ensure => file, content => template('sunet/xrootd/xrootd.cfg.erb'), } - $config['buckets'].each |$bucket| { + $xrootd_buckets.each |$bucket| { file { "/opt/xrootd/config/${bucket['name']}": ensure => directory, } diff --git a/templates/xrootd/xrootd.cfg.erb b/templates/xrootd/xrootd.cfg.erb index 0d987f21..084a6777 100644 --- a/templates/xrootd/xrootd.cfg.erb +++ b/templates/xrootd/xrootd.cfg.erb @@ -24,8 +24,8 @@ cms.allow host <%= host %> <% end -%> # Bucket specific s3 options -<% if @config['buckets'].is_a? Array and @config['buckets'].size > 0 -%> -<% @config['buckets'].each do |bucket| -%> +<% if @xrootd_buckets.is_a? Array and @xrootd_buckets.size > 0 -%> +<% @xrootd_buckets.each do |bucket| -%> # these must be in this order to allow parsing of multiple entries s3.begin s3.url_style path @@ -40,7 +40,7 @@ s3.end <% end -%> <% else -%> # You must configure at least one bucket hiera -# buckets: +# xrootd_buckets: # - name: my_bucket # bucket name # url_style: path # path or virtual # path_name: / # this is the path where it will be available on the xrootd side