Compare commits
2 Commits
500556c31d
...
2968582a74
Author | SHA1 | Date | |
---|---|---|---|
|
2968582a74 | ||
|
08390feb38 |
11
README.md
11
README.md
@ -44,19 +44,14 @@ Cette étape peut-être (très) longue. Notamment, la construction de kaz-prod s
|
||||
|
||||
## Mise au point
|
||||
|
||||
(Non implémenté) Il est possible d'interrompre la création à la coquille vide (juste la VM sans les services KAZ) pour des question de mise au point avec la commande :
|
||||
Il est possible d'interrompre la création à la coquille vide (juste la VM sans les services KAZ) pour des question de mise au point avec la commande :
|
||||
```bash
|
||||
NOKAZ="true" vagrant up
|
||||
```
|
||||
|
||||
(Non implémenté) Dans ce cas, il faudra ensuite lancer dans la VM :
|
||||
Dans ce cas, il faudra ensuite lancer dans la VM :
|
||||
```bash
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x /mnt/snster/root/snster-kaz/kaz/prod/kaz.sh
|
||||
SETUP_MAIL="docker exec mailServ setup"
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact1@kaz.sns toto"
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact2@kaz.sns toto"
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact3@kaz.sns toto"
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact4@kaz.sns toto"
|
||||
KAZGUARD="true" /root/vm-install-kaz.sh
|
||||
```
|
||||
|
||||
Pour détruire la VM et recommencer :
|
||||
|
@ -88,7 +88,7 @@ Vagrant.configure("2") do |config|
|
||||
config.vm.synced_folder "/tmp/", "/tmp_host"
|
||||
|
||||
config.vm.provision "shell" do |s|
|
||||
s.inline = "/vagrant/files/provision.sh"
|
||||
s.inline = "/vagrant/files/vm-provision.sh"
|
||||
s.env = {"KAZGUARD" => "true", "HOSTLANG" => ENV['LANG'], "NOKAZ" => ENV['NOKAZ'], "KAZBRANCH" => ENV['KAZBRANCH']}
|
||||
end
|
||||
end
|
||||
|
@ -61,13 +61,7 @@ export DebugLog="${OUTPUT_DIR}/log/log-kaz-$(date +%y-%m-%d-%T)-"
|
||||
echo -e "\n #### secretGen\n"
|
||||
/kaz/bin/secretGen.sh
|
||||
|
||||
#possibilité de lancer vagrant up NOKAZ="true" quand on construit la machine
|
||||
if [ "${NOKAZ}" == "true" ]; then
|
||||
echo "on ne lance pas install.sh"
|
||||
else
|
||||
echo "on lance install.sh"
|
||||
/kaz/bin/install.sh
|
||||
fi
|
||||
/kaz/bin/install.sh
|
||||
|
||||
# clear apt cache
|
||||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
|
||||
|
20
files/vm-install-kaz.sh
Normal file
20
files/vm-install-kaz.sh
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# Installation de Kaz
|
||||
|
||||
if [ -z "${KAZGUARD}" ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
snster -c /root/snster-kaz -t /root/templates start
|
||||
sleep 10
|
||||
snster -c /root/snster-kaz -t /root/templates 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 -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact1@kaz.sns toto"
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact2@kaz.sns toto"
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact3@kaz.sns toto"
|
||||
snster -c /root/snster-kaz -t /root/templates 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
|
@ -192,20 +192,16 @@ EOF
|
||||
|
||||
# Build SNSTER KAZ !
|
||||
snster -c /root/snster-kaz -t /root/templates create
|
||||
snster -c /root/snster-kaz -t /root/templates start
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x /mnt/snster/root/snster-kaz/kaz/prod/kaz.sh
|
||||
cp "${VAGRANT_SRC_DIR}/vm-install-kaz.sh" /root/
|
||||
chmod +x /root/vm-install-kaz.sh
|
||||
if [ "${NOKAZ}" == "true" ]; then
|
||||
echo "on ne fait pas l'install de kaz sur kaz-prod"
|
||||
else
|
||||
echo "on installe kaz sur kaz-prod"
|
||||
bash "/root/vm-install-kaz.sh"
|
||||
fi
|
||||
|
||||
# On crée quelques mails
|
||||
SETUP_MAIL="docker exec mailServ setup"
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact1@kaz.sns toto"
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact2@kaz.sns toto"
|
||||
snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact3@kaz.sns toto"
|
||||
snster -c /root/snster-kaz -t /root/templates 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
|
||||
|
||||
# On monte le filesystem de kaz-prod dans le /kaz de la VM pour le dév
|
||||
# On monte le filesystem de kaz-prod dans le /kaz de la VM pour le dév (en nofail)
|
||||
mkdir /kaz-prod /kaz
|
||||
echo "overlay /kaz-prod overlay lowerdir=/var/lib/lxc/sr-masters-bullseye/rootfs,upperdir=/var/lib/lxc/kaz-kaz-prod/overlay/delta,workdir=/var/lib/lxc/kaz-kaz-prod/overlay/work,nofail 0 0" >> /etc/fstab
|
||||
echo "/kaz-prod/kaz /kaz none bind,nofail 0 0" >> /etc/fstab
|
Loading…
Reference in New Issue
Block a user