This commit is contained in:
ahmadbilalkhalid 2019-09-10 17:35:34 +05:00
parent ec689ab43e
commit 0138fb3349
3 changed files with 24 additions and 1 deletions

View File

@ -39,6 +39,11 @@ def setup(path, base_dir, file_prefix, etcd_url):
sp.check_output(['pipenv','--site-packages', '--python', '3'], cwd=repo_name)
sp.check_output(['pipenv', 'install'], cwd=repo_name)
# TODO: Devuan/Debian have crontab under /etc/crontab
# while Alpine have it under /etc/crontabs/root
# Detect in the following code where should we write
# our crontab entries
# Write Crontab entry
with open("/etc/crontabs/root", "a") as crontab:
crontab.write(

View File

@ -39,6 +39,12 @@ def setup(path, base_dir, etcd_url, without_ceph):
sp.check_output(['pipenv','--site-packages', '--python', '3'], cwd=repo_name)
sp.check_output(['pipenv', 'install'], cwd=repo_name)
# TODO: Devuan/Debian have crontab under /etc/crontab
# while Alpine have it under /etc/crontabs/root
# Detect in the following code where should we write
# our crontab entries
# Write Crontab entry
with open("/etc/crontabs/root", "a") as crontab:
crontab.write(

14
init.sh
View File

@ -3,12 +3,24 @@ get_distro() {
echo $OS
}
# These directories would be need if user chooses
# to setup ucloud without CEPH
mkdir /var/vm
mkdir /var/www
mkdir /var/image
if ! grep -q "export LC_ALL=C.UTF-8" ~/.bashrc; then
echo 'export LC_ALL=C.UTF-8' >> ~/.bashrc
echo 'export LANG=C.UTF-8' >> ~/.bashrc
source ~/.bashrc
fi
if ! grep -q "alias etcdctl='ETCDCTL_API=3 etcdctl'" ~/.bashrc; then
echo "alias etcdctl='ETCDCTL_API=3 etcdctl'" >> ~/.bashrc
source ~/.bashrc
fi
case $(get_distro) in
"alpine")
# Install QEMU
@ -43,7 +55,7 @@ EOF
apt upgrade --yes
# Install QEMU
apt install qemu python3 ceph python-pip python3-pip etcd-client --yes
apt install qemu qemu-system python3 ceph python-pip python3-pip etcd-client --yes
;;
*)
echo "Unsupported OS/Distribution"