Commit 34c90543 authored by Victor Penso's avatar Victor Penso
Browse files

testing remote publishing

parent a9a13520
......@@ -20,6 +20,8 @@ if [ "$#" -eq "2" ]; then
repo_name=$2
case "$1" in
publish)
# Prepare repository for update
su cvmfs -c "ssh -qt $repo_name 'sudo cvmfs_server transaction $repo_name'"
# sync local data to the corresponding CVMFS server
su cvmfs -c "rsync -vtza --exclude-from /cvmfs/$repo_name.exclude --delete --delete-excluded /cvmfs/$repo_name $repo_name:/cvmfs/"
# Run publish on the CVMFS server as root, this needs to be
......
......@@ -36,6 +36,7 @@ node.cvmfs.remote.each_pair do |repo,config|
directory "/cvmfs/#{repo}" do
group maintainer
mode '0775'
recursive true
end
......@@ -74,13 +75,14 @@ sys_ssh_config 'cvmfs' do
end
if node.cvmfs.remote_key.empty?
Chef::Log.warn("No login SSH key to CVMFS servers provided")
Chef::Log.warn("No SSH login key to CVMFS servers provided")
else
file '/home/cvmfs/.ssh/id_rsa' do
content node.cvmfs.remote_key.gsub(/^ */,'').gsub(/^$\n/,'')
owner 'cvmfs'
group 'cvmfs'
mode '0600'
content node.cvmfs.remote_key
backup false
end
end
......
# /etc/sudoers.d/cvmfs
#
# DO NOT CHANGE THIS FILE MANUALLY!
#
# This file is managed by the Chef `cernvm-fs::remote` cookbook.
<%= @config %>
......@@ -23,6 +23,35 @@ default_attributes(
:server => 'lxfs02.devops.test',
:maintainer => [ 'lea', 'joda' ]
}
}
},
:remote_key => '
-----BEGIN RSA PRIVATE KEY-----
MIIEpgIBAAKCAQEA2d97tAhXfim3E9WoHqz98wGxue4lzylk/AAs55lonR4wJmtt
zvELw13N07iruzp7FqVepAjaTiasN+aX+3OsUSvmVVpPDJypBJvx7dlBrpFVrC4Z
QD3Mxtw3n/G5EdA68zsm0f8rVo51G8RnoNxMicIHpQO+iqTXP6nQXmMmSOvwoB9w
9IySn0XX7b/uAAv7QQah1HlGv0Ue7xuMk2rEPBwCLwh+KuRN1TtB7FhWQMcKHbTp
JqmhJlKCsb1y9Ywp7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X++5FsFLsfTgdsYt4g0iJ
ksW98jvv9/KhN6zLMMiAXvt2jMWeYHO2k6+2D7JPVhj3S1R7ak4tDZv2abkPc5xm
rrBwHDvJAoGBAKQgJ5EyoG2W1HptD+L4sZMUrE7eSyopQ2Ifi3i6TCIm1OlKtIUK
GUSvgZDbsoJdG/kcTbU7ocVvD5K0iDorAA82iudGkQMiE91K03SYdbARE075KSmj
jtFsUrYSo0xB5Q7nSpyO6H4YTKTuBeDb0E2g0Dugxqh+DKbAo10xBntx
-----END RSA PRIVATE KEY-----
'
}
)
name "cvmfs_server_test"
description "Use to test the [cvmfs::server] recipe."
run_list( "recipe[cernvm-fs]" )
run_list(
"recipe[sys::ssh]",
"recipe[cernvm-fs]"
)
default_attributes(
"cvmfs" => {
"server" => {
"repos" => [ 'alpha.devops.test' ]
:sys => {
:ssh => {
:authorize => {
'cvmfs' => {
:keys => [ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ33u0CFd+KbcT1agerP3zAbG57iXPKWT8ACznmWidHjAma23O8QvDXc3TuKu7OnsWpV6kCNpOJqw35pf7c6xRK+ZVWk8MnKkEm/Ht2UGukVWsLhlAPczG3Def8bkR0DrzOybR/ytWjnUbxGeg3EyJwgelA76KpNc/qdBeYyZI6/CgH3D0jJKfRdftv+4AC/tBBqHUeUa/RR7vG4yTasQ8HAIvCH4q5E3VO0HsWFZAxwodtOkmqaEmUoKxvXL1jCnttELzte1eQqMCkDtS4LhxfAeFGLwEDUTX+9eXstDkUY9BO0v1xDJnge5d0InVmBony1waXJU3Z7JTQTMj7aZ9' ]
}
}
}
},
:cvmfs => {
:server => {
:repos => [ 'alpha.devops.test' ]
}
}
)
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