mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-04 17:47:00 +03:00
feature-#1020: Add ssh support
This commit is contained in:
parent
487ec888b5
commit
445c8029b3
@ -210,6 +210,7 @@ LIB_DIRS="$LIB_LOCATION/ruby \
|
||||
$LIB_LOCATION/tm_commands/dummy \
|
||||
$LIB_LOCATION/tm_commands/lvm \
|
||||
$LIB_LOCATION/tm_commands/vmware \
|
||||
$LIB_LOCATION/tm_commands/vmware-ssh \
|
||||
$LIB_LOCATION/mads \
|
||||
$LIB_LOCATION/sh \
|
||||
$LIB_LOCATION/ruby/cli \
|
||||
@ -348,6 +349,7 @@ INSTALL_FILES=(
|
||||
SHARED_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/shared
|
||||
SSH_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/ssh
|
||||
VMWARE_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/vmware
|
||||
VMWARE_TM_SSH_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/vmware-ssh
|
||||
DUMMY_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/dummy
|
||||
LVM_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/lvm
|
||||
IMAGE_DRIVER_FS_SCRIPTS:$VAR_LOCATION/remotes/image/fs
|
||||
@ -683,6 +685,10 @@ VMWARE_TM_COMMANDS_LIB_FILES="src/tm_mad/vmware/tm_clone.sh \
|
||||
src/tm_mad/vmware/tm_ln.sh \
|
||||
src/tm_mad/vmware/tm_mv.sh"
|
||||
|
||||
VMWARE_TM_SSH_COMMANDS_LIB_FILES="src/tm_mad/vmware-ssh/tm_clone.sh \
|
||||
src/tm_mad/vmware-ssh/tm_ln.sh"
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Image Repository drivers, to be installed under $REMOTES_LOCATION/image
|
||||
# - FS based Image Repository, $REMOTES_LOCATION/image/fs
|
||||
@ -757,7 +763,8 @@ TM_DUMMY_ETC_FILES="src/tm_mad/dummy/tm_dummy.conf \
|
||||
TM_LVM_ETC_FILES="src/tm_mad/lvm/tm_lvm.conf \
|
||||
src/tm_mad/lvm/tm_lvmrc"
|
||||
|
||||
TM_VMWARE_ETC_FILES="src/tm_mad/vmware/tm_vmware.conf"
|
||||
TM_VMWARE_ETC_FILES="src/tm_mad/vmware/tm_vmware.conf \
|
||||
src/tm_mad/vmware/tm_vmware_ssh.conf"
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Hook Manager driver config. files, to be installed under $ETC_LOCATION/hm
|
||||
|
53
src/tm_mad/vmware-ssh/tm_clone.sh
Executable file
53
src/tm_mad/vmware-ssh/tm_clone.sh
Executable file
@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ---------------------------------------------------------------------------- #
|
||||
# Copyright 2010-2011, C12G Labs S.L #
|
||||
# #
|
||||
# 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. #
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
SRC=$1
|
||||
DST=$2
|
||||
|
||||
if [ -z "${ONE_LOCATION}" ]; then
|
||||
TMCOMMON=/usr/lib/one/mads/tm_common.sh
|
||||
else
|
||||
TMCOMMON=$ONE_LOCATION/lib/mads/tm_common.sh
|
||||
fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
DST_PATH=`arg_path $DST`
|
||||
DST_HOST=`arg_host $DST`
|
||||
|
||||
log "$1 $2"
|
||||
log "DST_HOST: $DST_HOST"
|
||||
log "DST_PATH: $DST_PATH"
|
||||
|
||||
log "Creating directory $DST_PATH"
|
||||
exec_and_log "$SSH $DST_HOST mkdir -p $DST_PATH"
|
||||
|
||||
case $SRC in
|
||||
http://*)
|
||||
log "Downloading $SRC"
|
||||
exec_and_log "$SSH $DST_HOST $WGET -O $DST_PATH $SRC"
|
||||
;;
|
||||
|
||||
*)
|
||||
log "Cloning $SRC"
|
||||
exec_and_log "$SCP -r $SRC/* $DST"
|
||||
;;
|
||||
esac
|
||||
|
||||
exec_and_log "$SSH $DST_HOST chmod a+rwx $DST_PATH"
|
||||
|
32
src/tm_mad/vmware-ssh/tm_ln.sh
Executable file
32
src/tm_mad/vmware-ssh/tm_ln.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ---------------------------------------------------------------------------- #
|
||||
# Copyright 2010-2011, C12G Labs S.L #
|
||||
# #
|
||||
# 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. #
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
SRC=$1
|
||||
DST=$2
|
||||
|
||||
if [ -z "${ONE_LOCATION}" ]; then
|
||||
TMCOMMON=/usr/lib/one/mads/tm_common.sh
|
||||
TM_COMMANDS_LOCATION=/usr/lib/one/tm_commands/
|
||||
else
|
||||
TMCOMMON=$ONE_LOCATION/lib/mads/tm_common.sh
|
||||
TM_COMMANDS_LOCATION=$ONE_LOCATION/lib/tm_commands/
|
||||
fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
exec $TM_COMMANDS_LOCATION/vmware-ssh/tm_clone.sh $SRC $DST
|
24
src/tm_mad/vmware-ssh/tm_vmware_ssh.conf
Normal file
24
src/tm_mad/vmware-ssh/tm_vmware_ssh.conf
Normal file
@ -0,0 +1,24 @@
|
||||
# ---------------------------------------------------------------------------- #
|
||||
# Copyright 2010-2011, C12G Labs S.L #
|
||||
# #
|
||||
# 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. #
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
CLONE = vmware-ssh/tm_clone.sh
|
||||
LN = vmware-ssh/tm_ln.sh
|
||||
MKSWAP = ssh/tm_mkswap.sh
|
||||
MKIMAGE = ssh/tm_mkimage.sh
|
||||
DELETE = ssh/tm_delete.sh
|
||||
MV = ssh/tm_mv.sh
|
||||
CONTEXT = ssh/tm_context.sh
|
||||
|
Loading…
x
Reference in New Issue
Block a user