client.rb 1.8 KB
Newer Older
Victor Penso's avatar
Victor Penso committed
1
# Cookbook Name:: cernvm-fs
2
# Recipe:: client
Victor Penso's avatar
Victor Penso committed
3
4
# Author:: Victor Penso
# Copyright:: 2013, GSI, HPC Department
5
6
7
8
9
10
11
12
13
14
15
16
17
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

18
node.default['sys']['autofs']['maps']['/cvmfs']['map'] = '/etc/auto.cvmfs'
19
20
21
22
include_recipe 'sys::autofs'

# Make sure the CMVFS user can use FUSE 
# to mount a repositories 
23
24
node.default['sys']['fuse']['config']['mount_max'] = 1000
node.default['sys']['fuse']['config']['user_allow_other'] = ''
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
include_recipe 'sys::fuse'

user 'cvmfs' do
  shell '/bin/bash'
  system true
end

group 'fuse' do
  members 'cvmfs'
end

directory node.cvmfs.client.default_local.cache_base do
  owner 'cvmfs'
  group 'cvmfs'
  mode '0755'
  recursive true
end

template '/etc/cvmfs/default.local' do
  source 'etc_cvmfs_default.local.erb'
  mode "0644"
  variables( 
    :repos => node.cvmfs.client.config_d.keys,
    :config => node.cvmfs.client.default_local
  )
end

directory '/etc/cvmfs/config.d'

# Each repository needs its configuration file
unless node.cvmfs.client.config_d.empty?
  node.cvmfs.client.config_d.each do |repo,config|
57
58
59
60
61

    config['http_proxy'] = 'DIRECT' unless config.has_key? 'http_proxy'

    template "/etc/cvmfs/config.d/#{repo}.conf" do
      source 'etc_cvmfs_config.d_generic.conf.erb'
62
63
64
      mode "0644"
      variables( :repo => repo, :config => config )
    end
65
66


67
68
69
  end
end