dicos/99_one-master.xml: Création des variables pour les Hook de type USER

On permet de configurer des HOOK de type USER qui lancent des actions lors de la CREATION des
utilisateurs.

ref #12522 @20m
This commit is contained in:
Philippe Caseiro 2015-08-12 12:09:03 +02:00
parent 62b0408cbe
commit ffec623695
2 changed files with 36 additions and 5 deletions

View File

@ -65,7 +65,7 @@
</variable> </variable>
<variable name='one_nodes' type='string' description='Noeud voisin du Cluster' multi='True'/> <variable name='one_nodes' type='string' description='Noeud voisin du Cluster' multi='True'/>
<variable name='node_ip' type='ip' description='Adresse IP du noeud' multi='True'/> <variable name='node_ip' type='ip' description='Adresse IP du noeud' multi='True'/>
<variable name='activer_vm_hooks' type='oui/non' description="Utiliser des hook de vm personnalisés" mode='expert'> <variable name='activer_hooks' type='oui/non' description="Utiliser des hook personnalisés" mode='expert'>
<value>non</value> <value>non</value>
</variable> </variable>
</family> </family>
@ -77,9 +77,13 @@
<variable name='hapy_vm_hook_remote' type='oui/non' description="Exécuter sur les noeuds (remote)" mode='expert'> <variable name='hapy_vm_hook_remote' type='oui/non' description="Exécuter sur les noeuds (remote)" mode='expert'>
<value>non</value> <value>non</value>
</variable> </variable>
<variable name='hapy_vm_hook_on' type='string' description="Déclancheur (ON)" mode='expert'/>
<variable name='hapy_vm_hook_state' type='string' description="Etat attendus en déclancheur 'custom' (STATE)" mode='expert'/> <variable name='hapy_vm_hook_state' type='string' description="Etat attendus en déclancheur 'custom' (STATE)" mode='expert'/>
<variable name='hapy_vm_hook_lcm_state' type='string' description="Etat 'lcm' attendus en déclancheur 'custom' (LCM_STATE)" mode='expert'/> <variable name='hapy_vm_hook_lcm_state' type='string' description="Etat 'lcm' attendus en déclancheur 'custom' (LCM_STATE)" mode='expert'/>
<variable name='hapy_user_hook' type='string' description="Nom du hook d' utilisateur" multi='True' mode='expert'/>
<variable name='hapy_user_hook_on' type='string' description="Déclancheur (on)" mode='expert'/>
<variable name='hapy_user_hook_command' type='string' description="Script a déclancher (command)" mode='expert'/>
<variable name='hapy_user_hook_arguments' type='string' description="Arguments a passer au script (arguments)" mode='expert'/>
</family> </family>
</variables> </variables>
@ -174,7 +178,7 @@
<target type='variable'>arp_cache_poisoning</target> <target type='variable'>arp_cache_poisoning</target>
</condition> </condition>
<condition name='disabled_if_in' source='activer_vm_hooks'> <condition name='disabled_if_in' source='activer_hooks'>
<param>non</param> <param>non</param>
<target type='family'>Hooks</target> <target type='family'>Hooks</target>
</condition> </condition>
@ -191,12 +195,22 @@
<slave>hapy_vm_hook_state</slave> <slave>hapy_vm_hook_state</slave>
<slave>hapy_vm_hook_lcm_state</slave> <slave>hapy_vm_hook_lcm_state</slave>
</group> </group>
<check name="valid_enum" target="hapy_user_hook_on">
<param>['CREATE','REMOVE']</param>
</check>
<group master='hapy_user_hook'>
<slave>hapy_user_hook_on</slave>
<slave>hapy_user_hook_command</slave>
<slave>hapy_user_hook_arguments</slave>
</group>
</constraints> </constraints>
<help> <help>
<variable name='activer_onesinglenode'>Interface d'administration du Cluster OpenNebula.</variable> <variable name='activer_onesinglenode'>Interface d'administration du Cluster OpenNebula.</variable>
<variable name='arp_cache_poisoning'>Active la protection contre les attaques par empoisonnement ARP. Non compatible avec les réseaux de Niveau 2</variable> <variable name='arp_cache_poisoning'>Active la protection contre les attaques par empoisonnement ARP. Non compatible avec les réseaux de Niveau 2</variable>
<variable name='activer_vm_hooks'>Activer la création de hook personnalisée sur le serveur Hâpy (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable> <variable name='activer_hooks'>Activer la création de hook personnalisée sur le serveur Hâpy (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
<variable name='hapy_vm_hook'>Nom du Hook de machine virtuelle (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable> <variable name='hapy_vm_hook'>Nom du Hook de machine virtuelle (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
<variable name='hapy_vm_hook_on'>Déclancheur du Hook (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable> <variable name='hapy_vm_hook_on'>Déclancheur du Hook (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
<variable name='hapy_vm_hook_command'>Script lancé par le Hook (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable> <variable name='hapy_vm_hook_command'>Script lancé par le Hook (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
@ -204,5 +218,9 @@
<variable name='hapy_vm_hook_remote'>Exécuter le script sur le noeud plutôt que sur le maitre (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable> <variable name='hapy_vm_hook_remote'>Exécuter le script sur le noeud plutôt que sur le maitre (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
<variable name='hapy_vm_hook_state'>État attendus par le hook lorsque le déclancheur est "CUSTOM" (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable> <variable name='hapy_vm_hook_state'>État attendus par le hook lorsque le déclancheur est "CUSTOM" (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
<variable name='hapy_vm_hook_lcm_state'>État LCM attendus par le hook lorsque le déclancheur est "CUSTOM" (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable> <variable name='hapy_vm_hook_lcm_state'>État LCM attendus par le hook lorsque le déclancheur est "CUSTOM" (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
<variable name='hapy_user_hook'>Nom du Hook d'utilisateur (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
<variable name='hapy_user_hook_on'>Déclancheur du Hook (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
<variable name='hapy_user_hook_command'>Script lancé par le Hook (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
<variable name='hapy_user_hook_arguments'>Arguments passés au script lancé par le Hook d'utilisateur (cf: http://docs.opennebula.org/4.8/integration/infrastructure_integration/hooks.html)</variable>
</help> </help>
</creole> </creole>

View File

@ -596,9 +596,11 @@ VM_HOOK = [
remote = "YES" remote = "YES"
] ]
%if %%getVar('activer_vm_hooks', 'non') == 'oui' %if %%getVar('activer_hooks', 'non') == 'oui'
#******************************************************************************* #*******************************************************************************
# Personal Hooks # Personal Hooks
#*******************************************************************************
# VM
#******************************************************************************* #*******************************************************************************
%for %%hook in %%hapy_vm_hook %for %%hook in %%hapy_vm_hook
VM_HOOK = [ VM_HOOK = [
@ -617,6 +619,17 @@ VM_HOOK = [
%end if %end if
] ]
%end for %end for
#*******************************************************************************
# USER
#*******************************************************************************
%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 = [ HM_MAD = [