28 lines
638 B
Text
28 lines
638 B
Text
{# Definitions utiles pour les templates #}\
|
|
{% if not defined("utils_included") %}{% python
|
|
utils_included = True
|
|
|
|
# Le nom d'hote court, la partie avant le premier '.'
|
|
hostname = metadata.hostname.split('.',1)[0]
|
|
|
|
# Le nom d'hote sur le vlan public
|
|
pubhostname = hostname + ".crans.org"
|
|
|
|
# Le nom d'hote sur le vlan
|
|
admhostname = hostname + ".adm.crans.org"
|
|
|
|
def has(group):
|
|
return group in metadata.groups
|
|
|
|
def yesno(b):
|
|
if b:
|
|
return "yes"
|
|
else:
|
|
return "no"
|
|
|
|
def onoff(b):
|
|
if b:
|
|
return "on"
|
|
else:
|
|
return "off"
|
|
%}{% end %}\
|