# Etape 00 = Etendre l'espace disque
lvextend -l +100%FREE /dev/mapper/eolebase--vg-root
resize2fs /dev/mapper/eolebase--vg-root

# Etape 01 = Installer eole-web
apt-get install eole-web make git
CreoleSet activer_ead_web non
CreoleSet activer_mysql non
CreoleSet activer_ead3 non
CreoleSet web_url eolebase.ac-test.fr
CreoleSet web_redirection /ninegate
reconfigure

# Etape 02 = installer docker et docker-compose
apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-compose

# Installer Envole
cd /root
mkdir git
cd /root/git
git clone https://forge.cadoles.com/Envole/envole.git
cd /root/git/envole
make install

cp /root/git/envole/misc/tools/e-reconfigure.sh /usr/bin/e-reconfigure
chmod +x /usr/bin/e-reconfigure

cp /root/git/envole/docker/envole.sh /usr/bin/envole
chmod +x /usr/bin/envole

## A FAIRE A LA MAIN CAR PAS POSSIBLE DE LES SET D'UN COUP

Lier Envole avec un scribe

CreoleSet cas_host envole.ac_test.fr
CreoleSet openldap_host envole.ac_test.fr
CreoleSet nextcloud_samba_host envole.ac_test.fr

# Définition des secrets
CreoleSet openldap_password changeme
CreoleSet database_rootpassword changeme
CreoleSet database_userpassword changeme
CreoleSet envole_adminpassword changeme
CreoleSet ninegate_secret changeme
CreoleSet keycload_userpassword changeme

Activation des applications

CreoleSet activer_nineboard oui
CreoleSet activer_nextcloud oui
CreoleSet activer_nextcloud oui
CreoleSet activer_wordpress oui
CreoleSet activer_phpldapadmin oui

# Appliquer la configuration
reconfigure