From fc2c3ac9c7765dfdbd1dff3522865c5cc7416e21 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Mon, 3 Oct 2016 11:36:05 +0200 Subject: [PATCH] Retour de la configuration des hooks ONE. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La migration entre les version 4 et 5 avait fait des victimes. Retour de la configuration pour le hook d'ajout et de suppression de règles de firewall pour l'ouverture des ports VNC. Retour de l'a possibilité d'ajouter des hooks personnes dans gen_config ref #17335 @2h --- tmpl/oned.conf | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/tmpl/oned.conf b/tmpl/oned.conf index a45a41c..b90019f 100644 --- a/tmpl/oned.conf +++ b/tmpl/oned.conf @@ -653,6 +653,80 @@ MARKET_MAD = [ # Please note: In a Federation, User and Group hooks can only be defined in # the master OpenNebula. #------------------------------------------------------------------------------- +# +VM_HOOK = [ + name = "open_ports", + on = "RUNNING", + command = "eole/graphicsfw", + arguments = "open $TEMPLATE", + remote = "YES" +] + +VM_HOOK = [ + name = "close_ports", + on = "DONE", + command = "eole/graphicsfw", + arguments = "close $TEMPLATE", + remote = "YES" +] + +VM_HOOK = [ + name = "close_ports", + on = "STOP", + command = "eole/graphicsfw", + arguments = "close $TEMPLATE", + remote = "YES" +] + +VM_HOOK = [ + name = "close_ports", + on = "SHUTDOWN", + command = "eole/graphicsfw", + arguments = "close $TEMPLATE", + remote = "YES" +] + +%if %%getVar('activer_hooks', 'non') == 'oui' +#******************************************************************************* +# Personal Hooks +#******************************************************************************* +# VM +#******************************************************************************* + %if %%hapy_vm_hooks == 'oui' + %for %%hook in %%hapy_vm_hook +VM_HOOK = [ + name = "%%hook", + on = "%%hook.hapy_vm_hook_on", + %if %%hook.hapy_vm_hook_on == "CUSTOM" + state = "%%hook.hapy_vm_hook_state", + lcm_state = "%%hook.hapy_vm_hook_lcm_state", + %end if + command = "%%hook.hapy_vm_hook_command", + arguments = "%%hook.hapy_vm_hook_arguments", + %if %%hook.hapy_vm_hook_remote == 'oui' + remote = "YES" + %else + remote = "NO" + %end if +] + %end for + %end if + +#******************************************************************************* +# USER +#******************************************************************************* + %if %%hapy_user_hooks == 'oui' + %for %%hook in %%hapy_user_hook +USER_HOOK = [ + name = "%%hook", + on = "%%hook.hapy_user_hook_on", + command = "%%hook.hapy_user_hook_command", + arguments = "%%hook.hapy_user_hook_arguments" +] + %end for + %end if +%end if + HM_MAD = [ EXECUTABLE = "one_hm" ]