client.rb 2 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
# Author:: Victor Penso
Victor Penso's avatar
Victor Penso committed
4
# Copyright:: 2013-2015, 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.

Victor Penso's avatar
Victor Penso committed
18
19
20
21
22
23

case node.platform_version
when /^7.*/
  node.default['sys']['autofs']['maps']['/cvmfs']['map'] = '/etc/auto.cvmfs'
  include_recipe 'sys::autofs'
end
24
25
26

# Make sure the CMVFS user can use FUSE 
# to mount a repositories 
27
28
node.default['sys']['fuse']['config']['mount_max'] = 1000
node.default['sys']['fuse']['config']['user_allow_other'] = ''
29
30
31
32
33
34
35
36
include_recipe 'sys::fuse'

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

group 'fuse' do
37
38
  # this should be a system group (ie. gid < 1000)
  system  true
39
  members 'cvmfs'
40
  append  true
41
42
end

b.neuburger's avatar
b.neuburger committed
43
44
execute 'modprobe fuse'

m.pausch's avatar
m.pausch committed
45
directory node['cvmfs']['client']['default_local']['cache_base'] do
46
47
48
49
50
51
52
53
54
  owner 'cvmfs'
  group 'cvmfs'
  mode '0755'
  recursive true
end

template '/etc/cvmfs/default.local' do
  source 'etc_cvmfs_default.local.erb'
  mode "0644"
m.pausch's avatar
m.pausch committed
55
56
57
  variables(
    :repos => node['cvmfs']['client']['config_d'].keys,
    :config => node['cvmfs']['client']['default_local']
58
59
60
61
62
63
  )
end

directory '/etc/cvmfs/config.d'

# Each repository needs its configuration file
m.pausch's avatar
m.pausch committed
64
65
unless node['cvmfs']['client']['config_d'].empty?
  node['cvmfs']['client']['config_d'].each do |repo,config|
66
67
68
69
70

    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'
71
72
73
      mode "0644"
      variables( :repo => repo, :config => config )
    end
74
75


76
77
  end
end