Commit ff5cd8d4 authored by Christopher Huhn's avatar Christopher Huhn 🥚
Browse files

Add possibility to create a domain.local instead of a domain.conf in /etc/cvmfs/domain.d

parent 57ddcad5
......@@ -53,3 +53,7 @@ suites:
client:
default_local:
http_proxy: 'http://proxy.gsi.de:3128/'
domain_d:
example.org:
local: true
foo: bar
......@@ -7,7 +7,7 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
source_url 'https://git.gsi.de:chef/cookbooks/cernvm-fs/'
issues_url 'https://git.gsi.de:chef/cookbooks/cernvm-fs/issues'
version "1.1.0"
version "1.2.0"
depends "sys", '>= 1.51.0'
depends "apache2", '< 8.0'
......
......@@ -95,7 +95,12 @@ directory '/etc/cvmfs/domain.d'
node['cvmfs']['client']['domain_d'].each do |repo, config|
template "/etc/cvmfs/domain.d/#{repo}.conf" do
# config['local'] = true will create a repo.local
# leaving an existing repo.conf intact:
domain_d = "/etc/cvmfs/domain.d/" + repo +
(config['local'] ? '.local' : '.conf')
template domain_d do
source 'etc_cvmfs_config.d_generic.conf.erb'
mode "0644"
variables(config: config)
......
......@@ -4,5 +4,8 @@
# This file is managed by the Chef `cvmfs::client` cookbook.
<% @config.each do |key,value| %>
CVMFS_<%= key.upcase %>="<%= value %>"
<%# 'local' is a special key that triggers creation of a .local instead of a conf
We ignore it here: %>
<%- next if key == 'local' -%>
CVMFS_<%= key.upcase %>="<%= value.to_s %>"
<% end %>
......@@ -64,3 +64,9 @@ describe command('cvmfs_config probe') do
its(:exit_status) { should be_zero }
its(:stderr) { should be_empty }
end
describe file('/etc/cvmfs/domain.d/example.org.local') do
it { should exist }
it { should_not contain 'CVMFS_LOCAL=' }
it { should contain 'CVMFS_FOO="bar"' }
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment