ansible integration

This commit is contained in:
Emmanuel Garette 2022-10-01 19:29:50 +02:00
parent abe9155b4c
commit 856607fc52
3 changed files with 15 additions and 12 deletions

View file

@ -9,6 +9,7 @@
<variable name="hide_secret" type="boolean" description="Les secrets sont obscurcis" mode="expert" help="Obscurcir les secrets peut permettre de générer des configurations diffusable sans problème de confidentialité ou pour comparer deux configurations générés à des moments différents"> <variable name="hide_secret" type="boolean" description="Les secrets sont obscurcis" mode="expert" help="Obscurcir les secrets peut permettre de générer des configurations diffusable sans problème de confidentialité ou pour comparer deux configurations générés à des moments différents">
<value>False</value> <value>False</value>
</variable> </variable>
<variable name="module_name" type="string" hidden="True" provider="global:module_name" mandatory="True"/>
<family name="network" description="Réseau"> <family name="network" description="Réseau">
<variable name="server_name" type="domainname" hidden="True" provider="global:server_name" mandatory="True"/> <variable name="server_name" type="domainname" hidden="True" provider="global:server_name" mandatory="True"/>
<variable name="zones_list" type="string" multi="True" description="Liste de toutes les zones" mandatory="True" hidden="True" provider="global:zones_name"/> <variable name="zones_list" type="string" multi="True" description="Liste de toutes les zones" mandatory="True" hidden="True" provider="global:zones_name"/>

View file

@ -9,7 +9,7 @@ from os import makedirs as _makedirs
#from risotto.utils import ZONES_SERVER #from risotto.utils import ZONES_SERVER
_HERE = _dirname(_abspath(__main__.__file__)) _HERE = _dirname(_dirname(_abspath(__main__.__file__)))
_PASSWORD_DIR = _join(_HERE, 'password') _PASSWORD_DIR = _join(_HERE, 'password')

View file

@ -2,6 +2,7 @@
HOST_NAME=$1 HOST_NAME=$1
IMAGE_NAME=$2 IMAGE_NAME=$2
MACHINE=$3 MACHINE=$3
exit 0
. config.sh . config.sh
. config_machine.sh . config_machine.sh
if [ -z "$MACHINE" ]; then if [ -z "$MACHINE" ]; then
@ -40,24 +41,25 @@ fi
if [ "$NEW_CONF" = true ]; then if [ "$NEW_CONF" = true ]; then
echo " - delete old settings" echo " - delete old settings"
./diff.py "$MACHINE" "$MACHINE_RISOTTO_CONFIG_DIR" "$MACHINE_RISOTTO_CONFIG_DIR_LOCAL" > "$MACHINE_RISOTTO_CONFIG_DIR"_changelog.md ./diff.py "$MACHINE" "$MACHINE_RISOTTO_CONFIG_DIR" "$MACHINE_RISOTTO_CONFIG_DIR_LOCAL" > "$MACHINE_RISOTTO_CONFIG_DIR"_changelog.md
rm -rf "$MACHINE_RISOTTO_CONFIG_DIR" # rm -rf "$MACHINE_RISOTTO_CONFIG_DIR"
fi fi
cp -a "$MACHINE_NAME_NSPAWN_LOCAL" "$MACHINE_NAME_NSPAWN" #cp -a "$MACHINE_NAME_NSPAWN_LOCAL" "$MACHINE_NAME_NSPAWN"
cp -a "$MACHINE_NAME_SCRIPT_LOCAL" "$MACHINE_NAME_SCRIPT" #cp -a "$MACHINE_NAME_SCRIPT_LOCAL" "$MACHINE_NAME_SCRIPT"
if [ ! -d "$MACHINE_RISOTTO_CONFIG_DIR" ]; then #if [ ! -d "$MACHINE_RISOTTO_CONFIG_DIR" ]; then
cp -a "$MACHINE_RISOTTO_CONFIG_DIR_LOCAL" "$MACHINE_RISOTTO_CONFIG_DIR" # cp -a "$MACHINE_RISOTTO_CONFIG_DIR_LOCAL" "$MACHINE_RISOTTO_CONFIG_DIR"
fi #fi
if [ ! -d "$MACHINE_RISOTTO_SRV_DIR" ] && [ -d "$MACHINE_RISOTTO_SRV_DIR_LOCAL" ]; then #if [ ! -d "$MACHINE_RISOTTO_SRV_DIR" ] && [ -d "$MACHINE_RISOTTO_SRV_DIR_LOCAL" ]; then
mkdir -p "$MACHINE_RISOTTO_SRV_DIR" # mkdir -p "$MACHINE_RISOTTO_SRV_DIR"
fi #fi
mkdir -p "$RISOTTO_JOURNALD_DIR" #mkdir -p "$RISOTTO_JOURNALD_DIR"
if [ ! -d "$MACHINE_MACHINES_DIR" ]; then if [ ! -d "$MACHINE_MACHINES_DIR" ]; then
cd "$MACHINES_DIR" cd "$MACHINES_DIR"
mkdir "$IMAGE_NAME"
cd "$IMAGE_NAME"
tar xf "$IMAGE_NAME_RISOTTO_IMAGE_NAME" tar xf "$IMAGE_NAME_RISOTTO_IMAGE_NAME"
mkdir -p "$SHA_MACHINE_DIR" mkdir -p "$SHA_MACHINE_DIR"
cp -a "$IMAGE_NAME_RISOTTO_IMAGE_NAME".sha "$SHA_MACHINE" cp -a "$IMAGE_NAME_RISOTTO_IMAGE_NAME".sha "$SHA_MACHINE"
mv "$IMAGE_NAME" "$MACHINE_MACHINES_DIR"
cd - > /dev/null cd - > /dev/null
fi fi