Commit 8ba2a4e8 authored by Victor Penso's avatar Victor Penso Committed by Victor Penso
Browse files

first woroking version of client recipe

parent 83f7c10e
default[:cvmfs][:client][:default_local][:default_domain] = node.domain
default[:cvmfs][:client][:default_local][:cache_base] = '/var/cache/cvmfs'
default[:cvmfs][:client][:default_local][:quota_limit] = 20000
default[:cvmfs][:client][:default_local][:max_ttl] = 30
default[:cvmfs][:client][:config_d] = Hash.new
......@@ -63,7 +63,7 @@ Deploy the HTTP proxy:
## Clients
Make sure FUSE is correctly configured
Make sure FUSE is correctly configured:
» chgrp fuse /dev/fuse
» chmod 0660 /dev/fuse
......@@ -74,6 +74,8 @@ Make sure FUSE is correctly configured
» cvmfs_config chksetup
OK
Configure the CVMFS client:
» cat /etc/cvmfs/default.local
CVMFS_REPOSITORIES="repo.devops.test"
CVMFS_CACHE_BASE=/var/cache/cvmfs
......@@ -86,6 +88,8 @@ Make sure FUSE is correctly configured
» cvmfs_config chksetup
OK
Mount the repository:
» mkdir -p /cvmfs/repo.devops.test
» mount -t cvmfs repo.devops.test /cvmfs/repo.devops.test/
CernVM-FS: running with credentials 999:999
......@@ -94,7 +98,6 @@ Make sure FUSE is correctly configured
» cvmfs_config probe
Probing /cvmfs/repo.devops.test... OK
[1] [CernVM-FS Downloads][1]
[2] [CernVM-FS Technical Information][2]
......
maintainer "Victor Penso"
maintainer_email "vic.penso@gmail.com"
license "Apache 2.0"
description "Installs/Configures cvmfs"
description "Deploy CernVM-FS clients and repository servers."
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.1"
depends "apache2"
depends "sys"
supports "debian", ">= 7.0"
......@@ -17,3 +17,58 @@
# limitations under the License.
#
node.default[:sys][:autofs][:master][:'/cvmfs'][:map] = '/etc/auto.cvmfs'
include_recipe 'sys::autofs'
# Make sure the CMVFS user can use FUSE
# to mount a repositories
node.default[:sys][:fuse][:config] = {
'mount_max' => 1000,
'user_allow_other' => ''
}
# Deploy the changes using the Sys cookbook
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
#unless node.cvmfs.client.default_local.has_key? 'repositories'
# node.default[:cvmfs][:client][:default_local][:repositories] = "#{node.cvmfs.client.config_d.join(',')}"
#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|
template "/etc/cvmfs/config.d/#{repo}.local" do
source 'etc_cvmfs_config.d_generic.local.erb'
mode "0644"
variables( :repo => repo, :config => config )
end
end
end
# /etc/cvmfs/config.d/<%= @repo %>.local
#
# DO NOT CHANGE THIS FILE MANUALLY!
#
# This file is managed by the Chef `cvmfs::client` cookbook.
<% @config.each do |key,value| %>
CVMFS_<%= key.upcase %>=<%= value %>
<% end %>
# /etc/cvmfs/default.local
#
# DO NOT CHANGE THIS FILE MANUALLY!
#
# This file is managed by the Chef `cvmfs::client` cookbook.
CVMFS_REPOSITORIES=<%= @repos.join(',') %>
<% @config.each do |key,value| %>
CVMFS_<%= key.upcase %>=<%= value %>
<% end %>
......@@ -3,6 +3,19 @@ description "Use to test the [cvmfs::client] recipe."
run_list( "recipe[cvmfs]" )
default_attributes(
"cvmfs" => {
"version" => "2.1.8"
"version" => "2.1.8",
"client" => {
"config_d" => {
"hades.devops.test" => {
"server_url" => "http://lxfs01.devops.test/cvmfs/@org@",
"http_proxy" => "DIRECT",
"public_key" => "/etc/cvmfs/keys/hades.devops.test.pub"
},
"apollo.devops.test" => {
"server_url" => "http://lxfs02.devops.test/cvmfs/@org@",
"public_key" => "/etc/cvmfs/keys/apollo.devops.test.pub"
}
}
}
}
)
Supports Markdown
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