-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from indigo-dc/one5-packaging
One5 packaging
- Loading branch information
Showing
10 changed files
with
138 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
set -e | ||
NODE=master | ||
VERSION=1.0-2 | ||
VERSION=1.1 | ||
APP=onedock | ||
BASE_FOLDER=. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,82 @@ | ||
#!/bin/bash | ||
ONE_VER=$(dpkg -s opennebula | grep 'Version' | awk '{split($2,onev,"."); print onev[1]}') | ||
set -e | ||
|
||
function configure_one4 { | ||
cat >> /etc/one/oned.conf << EOT | ||
#******************************************************************************* | ||
# ONEDOCK configuration | ||
#******************************************************************************* | ||
IM_MAD = [ | ||
name = "onedock", | ||
executable = "one_im_ssh", | ||
arguments = "-r 3 -t 15 onedock" | ||
] | ||
VM_MAD = [ | ||
name = "onedock", | ||
executable = "one_vmm_exec", | ||
arguments = "-t 15 -r 0 onedock", | ||
type = "xml" | ||
] | ||
TM_MAD_CONF = [ | ||
name = "onedock", ln_target = "SYSTEM", clone_target = "SYSTEM", shared = "yes" | ||
] | ||
EOT | ||
|
||
sed -i.bak-onedock '/^[ \t]*TM_MAD[ \t]*=[ \t]*\[/,/\][ \t]*$/{ | ||
s/\(arguments[ ]*=[ ]*\"[^\"]*\)\(".*$\)/\1,onedock\2/}; | ||
/^[ \t]*DATASTORE_MAD[ \t]*=[ \t]*\[/,/\][ \t]*$/{ | ||
s/\(arguments[ ]*=[ ]*\"[^\"]*\)\(".*$\)/\1,onedock\2/}' \ | ||
/etc/one/oned.conf | ||
} | ||
|
||
function configure_one5 { | ||
cat >> /etc/one/oned.conf << EOT | ||
#******************************************************************************* | ||
# ONEDOCK configuration | ||
#******************************************************************************* | ||
IM_MAD = [ | ||
name = "onedock", | ||
executable = "one_im_ssh", | ||
arguments = "-r 3 -t 15 onedock" ] | ||
NAME = "onedock", | ||
SUNSTONE_NAME = "ONEDock", | ||
EXECUTABLE = "one_im_ssh", | ||
ARGUMENTS = "-r 3 -t 15 onedock" | ||
] | ||
VM_MAD = [ | ||
name = "onedock", | ||
executable = "one_vmm_exec", | ||
arguments = "-t 15 -r 0 onedock", | ||
type = "xml" ] | ||
NAME = "onedock", | ||
SUNSTONE_NAME = "ONEDock", | ||
EXECUTABLE = "one_vmm_exec", | ||
ARGUMENTS = "-t 15 -r 0 onedock", | ||
TYPE = "xml", | ||
KEEP_SNAPSHOTS = "no", | ||
IMPORTED_VMS_ACTIONS = "terminate, terminate-hard, hold, release, delete, reboot, reboot-hard" | ||
] | ||
TM_MAD_CONF = [ | ||
name = "onedock", ln_target = "SYSTEM", clone_target = "SYSTEM", shared = "yes" | ||
NAME = "onedock", LN_TARGET = "SELF", CLONE_TARGET = "SELF", SHARED = "YES", DS_MIGRATE = "NO" | ||
] | ||
DS_MAD_CONF = [ | ||
NAME = "onedock", REQUIRED_ATTRS = "", PERSISTENT_ONLY = "NO" | ||
] | ||
EOT | ||
|
||
echo "Cmnd_Alias ONEDOCK = /var/tmp/one/docker-manage-network,\ | ||
/usr/bin/qemu-nbd, /sbin/losetup, /bin/mount" >> /etc/sudoers.d/opennebula | ||
sed -i.bak-onedock 's/^\(oneadmin ALL=.*\)$/\1, ONEDOCK/' /etc/sudoers.d/opennebula | ||
sed -i.bak '/^[ \t]*TM_MAD[ \t]*=[ \t]*\[/,/\][ \t]*$/{s/\(ARGUMENTS[ ]*=[ ]*\"[^\"]*\)\(".*$\)/\1,onedock\2/};/^[ \t]*DATASTORE_MAD[ \t]*=[ \t]*\[/,/\][ \t]*$/{s/\(ARGUMENTS[ ]*=[ ]*\"[^\"]*-d [^\"]*\)\( -s [^\"]*\)\(".*$\)/\1,onedock\2,onedock\3/}' /etc/one/oned.conf | ||
} | ||
|
||
if [ $ONE_VER -eq 5 ]; then | ||
configure_one5 | ||
else | ||
configure_one4 | ||
fi | ||
|
||
sed -i.bkp -e "s/export LOCAL_SERVER=.*/export LOCAL_SERVER=$(hostname):5000/g" /var/lib/one/remotes/onedock.conf | ||
sed -i.bak-onedock 's/^\(oneadmin ALL=.*\)$/\1, ONEDOCK/' /etc/sudoers.d/opennebula | ||
echo "Cmnd_Alias ONEDOCK = /var/tmp/one/docker-manage-network, /usr/bin/qemu-nbd, /sbin/losetup, /bin/mount" >> /etc/sudoers.d/opennebula | ||
usermod -aG docker oneadmin | ||
touch /var/log/onedock.log && chown oneadmin:oneadmin /var/log/onedock.log | ||
chown -R oneadmin:oneadmin /var/lib/one/remotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
set -e | ||
NODE=master | ||
VERSION=1.0 | ||
VERSION=1.1 | ||
APP=onedock | ||
BASE_FOLDER=. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters