eole-redis/dicos/90_redis.xml

119 lines
5.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<creole>
<files>
<!-- System configuration -->
<file filelist='redis' name='/etc/redis/redis.conf' mkdir='True' rm='True'/>
<file filelist='redisCl' name='/etc/redis/cluster.conf' source='redis-cluster.conf' mkdir='True' rm='True'/>
<service servicelist="svredis">redis-server</service>
<service_access service='redis-server'>
<port service_accesslist='saRedis' protocol='tcp' port_type='SymLinkOption'>redisPort</port>
</service_access>
<service_restriction service='ead_web'>
<ip interface='auto' netmask='rdClmask' netmask_type='SymLinkOption' ip_type='SymLinkOption'>rdClIP</ip>
<ip interface='auto' netmask='255.255.255.255' ip_type='SymLinkOption'>redisMasterIP</ip>
</service_restriction>
</files>
<variables>
<family name='Services'>
<variable name='activer_redis' type='oui/non' description="Activer le service de cache Redis ?">
<value>oui</value>
</variable>
</family>
<family name="Redis">
<variable name='redisMode' type='string' description="Mode d'utilisation de Redis">
<value>Local</value>
</variable>
<variable name='redisPort' type='string' description="Port d'écoute du service Redis">
<value>6379</value>
</variable>
<variable name='redisMaxMemory' type='number' description="Quantité de mémoire utilisable par Redis en Mo">
<value>512</value>
</variable>
<variable name='redisMemoryPolicy' type='string' description='Méthode de libération de mémoire lorsque la maximum est atteint '>
<value>noeviction</value>
</variable>
<variable name='redisTCPKeepAlive' type='number' description="Intervalle entre le dernier envoi de paquet TCP et la réponse ACK (en secondes)">
<value>60</value>
</variable>
<variable name='rdClIP' type='ip' description="Adresse IP réseau autorisée a utiliser le service Redis" multi='True'/>
<variable name='rdClmask' type='ip' description="Masque de sous réseau"/>
<!-- Cluster configration Part -->
<variable name='redisRole' type='string' description="Role du serveur Redis">
<value>Leader</value>
</variable>
<variable name='redisMasterIP' type='ip' description="Adresse IP du Leader Redis"/>
<variable name='redisMasterPort' type='number' description="Port d'écoute du Leader Redis"/>
<variable name='redisMasterPassword' type='string' description="Passphrase d'accès à la grappe Redis"/>
<variable name='rdClMemberIP' type='ip' description="Adresse IP du noeud" multi='True'/>
<variable name='rdClMemberPort' type='number' description="Port d'écoute du noeud" multi='True'/>
<variable name='rdClMemberRole' type='ip' description="Rôle du membre"/>
<variable name='rdClMemberMaster' type='ip' description="Noeud source des données pour ce membre"/>
</family>
<separators>
<separator name='rdClIP'>Autorisation d'accès au service Redis</separator>
<separator name='redisRole'>Grappe Redis</separator>
<separator name='rdClMemberIP'>Serveurs membres de la grappe Redis</separator>
</separators>
</variables>
<constraints>
<condition name='disabled_if_in' source='activer_redis'>
<param>non</param>
<target type='filelist'>redis</target>
<target type='family'>Redis</target>
<target type='service_accesslist'>saredis</target>
<target type='servicelist'>svredis</target>
</condition>
<condition name='disabled_if_in' source='redisMode'>
<param>Local</param>
<target type='variable'>redisRole</target>
<target type='variable'>redisMasterIP</target>
<target type='variable'>redisMasterPort</target>
<target type='variable'>redisMasterPassword</target>
<target type='filelist'>redisCl</target>
</condition>
<condition name='disabled_if_in' source='redisRole'>
<param>Leader</param>
<target type='variable'>redisMasterIP</target>
<target type='variable'>redisMasterPort</target>
</condition>
<condition name='disabled_if_in' source='redisRole'>
<param>Node</param>
<target type='filelist'>redisCl</target>
</condition>
<condition name='disabled_if_in' source='rdClMemberRole'>
<param>master</param>
<target type='variable'>rdClMemberMaster</target>
</condition>
<group master='rdClIP'>
<slave>rdClmask</slave>
</group>
<group master='rdClMemberIP'>
<slave>rdClMemberPort</slave>
<slave>rdClMemberRole</slave>
<slave>rdClMemberMaster</slave>
</group>
<check name="valid_enum" target="redisRole">
<param>['Leader','Node']</param>
</check>
<check name="valid_enum" target="redisMode">
<param>['Local','Cluster']</param>
</check>
<check name="valid_enum" target="rdClMemberRole">
<param>['master','slave']</param>
</check>
<check name="valid_enum" target="redisMemoryPolicy">
<param>['noeviction', 'allkeys-lru','volatile-lru','volatile-random', 'allkeys-random','volatile-ttl']</param>
</check>
</constraints>
<help>
<variable name='activer_redis'>Activer le service de cache Redis</variable>
</help>
</creole>