install kaz durant le snster create
This commit is contained in:
parent
f6d3134004
commit
797d557afc
@ -22,47 +22,30 @@ export DebugLog="${OUTPUT_DIR}/log/log-kaz-$(date +%y-%m-%d-%T)-"
|
|||||||
fi
|
fi
|
||||||
echo -e "\n #### git checkout ${KAZBRANCH}\n"
|
echo -e "\n #### git checkout ${KAZBRANCH}\n"
|
||||||
|
|
||||||
|
|
||||||
# copie des sources
|
# copie des sources
|
||||||
cd /
|
cd /
|
||||||
[ -f kaz ] || git clone https://git.kaz.bzh/KAZ/kaz.git
|
git clone https://git.kaz.bzh/KAZ/kaz.git
|
||||||
(cd /kaz ; git checkout "${KAZBRANCH}" )
|
(cd /kaz ; git checkout "${KAZBRANCH}" )
|
||||||
find /kaz -name \*.sh -exec chmod a+x {} \;
|
|
||||||
|
|
||||||
# pour ceux qui disposent d'un cache apt local et pas la fibre
|
cp "${DIR}/kaz-config/dockers.env" /kaz/config/dockers.env
|
||||||
if [ -f "${DIR}/.apt-mirror-config" ]; then
|
|
||||||
rsync -a "${DIR}/.apt-mirror-config" /kaz/
|
|
||||||
fi
|
|
||||||
if [ -f "${DIR}/.proxy-config" ]; then
|
|
||||||
rsync -a "${DIR}/.proxy-config" /etc/profile.d/proxy.sh
|
|
||||||
rsync -a "${DIR}/.proxy-config" /kaz/
|
|
||||||
fi
|
|
||||||
if [ -f "${DIR}/.docker-config.json" ]; then
|
|
||||||
mkdir -p /root/.docker
|
|
||||||
rsync -a "${DIR}/.docker-config.json" /root/.docker/config.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo -e "\n #### rsync download\n"
|
|
||||||
[ -d "${DIR}/kaz/download" ] &&
|
|
||||||
rsync -a "${DIR}/kaz/download/" /kaz/download/
|
|
||||||
[ -d "${DIR}/kaz/git" ] &&
|
|
||||||
rsync -a "${DIR}/kaz/git/" /kaz/git/
|
|
||||||
[ -f "${DIR}/kaz/config/dockers.env" ] &&
|
|
||||||
[ ! -f "/kaz/config/dockers.env" ] &&
|
|
||||||
rsync -a "${DIR}/kaz/config/dockers.env" /kaz/config/dockers.env
|
|
||||||
for type in mail orga proxy withMail withoutMail ; do
|
for type in mail orga proxy withMail withoutMail ; do
|
||||||
[ -f "${DIR}/kaz/config/container-${type}.list" ] &&
|
[ -f "${DIR}/kaz-config/container-${type}.list" ] &&
|
||||||
[ ! -f "/kaz/config/config/container-${type}.list" ] &&
|
cp "${DIR}/kaz-config/container-${type}.list" /kaz/config/
|
||||||
rsync -a "${DIR}/kaz/config/container-${type}.list" /kaz/config/
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "\n #### secretGen\n"
|
echo -e "\n #### secretGen\n"
|
||||||
/kaz/bin/secretGen.sh
|
/kaz/bin/secretGen.sh
|
||||||
|
|
||||||
|
echo -e "\n #### install\n"
|
||||||
/kaz/bin/install.sh
|
/kaz/bin/install.sh
|
||||||
|
|
||||||
|
# On crée quelques mails
|
||||||
|
SETUP_MAIL="docker exec mailServ setup"
|
||||||
|
${SETUP_MAIL} email add contact1@kaz.sns toto
|
||||||
|
${SETUP_MAIL} email add contact2@kaz.sns toto
|
||||||
|
${SETUP_MAIL} email add contact3@kaz.sns toto
|
||||||
|
${SETUP_MAIL} email add contact4@kaz.sns toto
|
||||||
|
|
||||||
# clear apt cache
|
# clear apt cache
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
|
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get clean
|
DEBIAN_FRONTEND=noninteractive apt-get clean
|
||||||
|
@ -55,12 +55,6 @@ if [ -d letsencrypt ]; then
|
|||||||
/usr/sbin/update-ca-certificates --fresh
|
/usr/sbin/update-ca-certificates --fresh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ./kaz.sh
|
|
||||||
|
|
||||||
# On démarre au boot
|
|
||||||
echo -e '#!/bin/sh\n/kaz/bin/container.sh start' >> /etc/rc.local
|
|
||||||
chmod +x /etc/rc.local
|
|
||||||
|
|
||||||
# On sauve le proxy APT
|
# On sauve le proxy APT
|
||||||
proxy=$(/sbin/ip route | awk '/default/ { print $3 }' | head -1)
|
proxy=$(/sbin/ip route | awk '/default/ { print $3 }' | head -1)
|
||||||
sed -i -e "s/^proxy.*$/proxy=$proxy/" /usr/local/sbin/detect_proxy.sh
|
sed -i -e "s/^proxy.*$/proxy=$proxy/" /usr/local/sbin/detect_proxy.sh
|
||||||
@ -98,6 +92,23 @@ service docker restart
|
|||||||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
|
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get clean
|
DEBIAN_FRONTEND=noninteractive apt-get clean
|
||||||
|
|
||||||
|
# On installe Kaz
|
||||||
|
ifconfig lo:0 100.80.0.2
|
||||||
|
ifconfig lo:1 100.80.1.2
|
||||||
|
echo "100.80.0.2 smtp imap www mail cloud cloud.kaz.sns tableur tableur.kaz.sns webmail webmail.kaz.sns garradin garradin.kaz.sns wiki wiki.kaz.sns git git.kaz.sns office office.kaz.sns depot depot.kaz.sns ldap ldap.kaz.sns" >> /etc/hosts
|
||||||
|
echo "100.80.1.2 listes listes.kaz.sns" >> /etc/hosts
|
||||||
|
cp "${DIR}/kaz.sh" /root/kaz.sh
|
||||||
|
cp -ar "${DIR}/kaz-config" /root/
|
||||||
|
chmod +x /root/kaz.sh
|
||||||
|
bash "/root/kaz.sh"
|
||||||
|
sed -i -e "s/100.80.0.2.*//g" /etc/hosts
|
||||||
|
sed -i -e "s/100.80.1.2.*//g" /etc/hosts
|
||||||
|
|
||||||
|
|
||||||
|
# On démarre au boot
|
||||||
|
echo -e '#!/bin/sh\n/kaz/bin/container.sh start' >> /etc/rc.local
|
||||||
|
chmod +x /etc/rc.local
|
||||||
|
|
||||||
|
|
||||||
# notes fuse-overlayfs :
|
# notes fuse-overlayfs :
|
||||||
#mknod -m 666 /dev/fuse c 10 229
|
#mknod -m 666 /dev/fuse c 10 229
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Installation de Kaz
|
|
||||||
|
|
||||||
if [ -z "${KAZGUARD}" ] ; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
snster -c /root/snster-kaz start
|
|
||||||
sleep 10
|
|
||||||
snster -c /root/snster-kaz attach kaz-prod -x /mnt/snster/root/snster-kaz/kaz/prod/kaz.sh
|
|
||||||
|
|
||||||
# On crée quelques mails
|
|
||||||
SETUP_MAIL="docker exec mailServ setup"
|
|
||||||
snster -c /root/snster-kaz attach kaz-prod -x "${SETUP_MAIL} email add contact1@kaz.sns toto"
|
|
||||||
snster -c /root/snster-kaz attach kaz-prod -x "${SETUP_MAIL} email add contact2@kaz.sns toto"
|
|
||||||
snster -c /root/snster-kaz attach kaz-prod -x "${SETUP_MAIL} email add contact3@kaz.sns toto"
|
|
||||||
snster -c /root/snster-kaz attach kaz-prod -x "${SETUP_MAIL} email add contact4@kaz.sns toto"
|
|
||||||
|
|
||||||
echo -e '#!/bin/sh\nsnster -c /root/snster-kaz start' >> /etc/rc.local
|
|
||||||
chmod +x /etc/rc.local
|
|
@ -200,16 +200,11 @@ auth:
|
|||||||
|
|
||||||
# Build SNSTER KAZ !
|
# Build SNSTER KAZ !
|
||||||
snster -c /root/snster-kaz create
|
snster -c /root/snster-kaz create
|
||||||
cp "${VAGRANT_SRC_DIR}/vm-install-kaz.sh" /root/
|
|
||||||
chmod +x /root/vm-install-kaz.sh
|
|
||||||
cp "${VAGRANT_SRC_DIR}/vm-upgrade.sh" /root/
|
cp "${VAGRANT_SRC_DIR}/vm-upgrade.sh" /root/
|
||||||
chmod +x /root/vm-upgrade.sh
|
chmod +x /root/vm-upgrade.sh
|
||||||
if [ "${NOKAZ}" == "true" ]; then
|
|
||||||
echo "on ne fait pas l'install de kaz sur kaz-prod"
|
echo -e '#!/bin/sh\nsnster -c /root/snster-kaz start' >> /etc/rc.local
|
||||||
else
|
chmod +x /etc/rc.local
|
||||||
echo "on installe kaz sur kaz-prod"
|
|
||||||
bash "/root/vm-install-kaz.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "########## ********** End Vagrant $(date +%D-%T)"
|
echo "########## ********** End Vagrant $(date +%D-%T)"
|
||||||
) > >(tee ${DebugLog}stdout.log) 2> >(tee ${DebugLog}stderr.log >&2)
|
) > >(tee ${DebugLog}stdout.log) 2> >(tee ${DebugLog}stderr.log >&2)
|
||||||
|
Loading…
Reference in New Issue
Block a user