reworks on ip

This commit is contained in:
Emmanuel Garette 2021-02-19 10:50:28 +01:00
parent 0ccd3405db
commit bc25216c27
47 changed files with 219 additions and 156 deletions

View File

@ -6,59 +6,21 @@ La gestion des IP se fait dans un conteneur de [service](service.md).
La déclaration de l'attribut permet d'associer une IP autorisé à accéder au service. La déclaration de l'attribut permet d'associer une IP autorisé à accéder au service.
Il est nécessaire, au minimum, de spécifier son adresse IP et l'interface : Il est nécessaire, au minimum, de spécifier le nom d'une variable de type "IP" :
``` ```
<ip interface="ens3">192.168.0.1</ip> <ip ip_type="variable">variable_ip</ip>
``` ```
L'IP peut être un variable :
```
<ip interface="ens3" ip_type="variable">variable_ip</ip>
```
Attention, la variable doit être de type "network".
## La gestion d'un réseau ## La gestion d'un réseau
L'adresse IP peut être un réseau : L'adresse peut être de type réseau ("network") :
``` ```
<ip interface="ens3" netmask="255.255.255.0">192.168.0.0</ip> <ip netmask="variable_netmask">variable_ip</ip>
``` ```
Le masque de réseau peut être un variable : Attention, dans ce cas il faut préciser une variable de type "netmask" dans l'attribut netmask.
```
<ip interface="ens3" netmask_type="variable" netmask="variable_netmask" ip_type="variable">variable_ip</ip>
```
Attention, la variable doit être de type "netmask".
## L'interface
Il est possible de spécifier le nom de l'interface si on la connait :
```
<ip interface="ens3">192.168.0.1</ip>
```
Mais il est possible de calculer automatiquement cette valeur :
```
<ip interface="auto">192.168.0.1</ip>
```
Dans ce cas l'interface est déduite à partir de la table de routage.
L'interface peut être un variable :
```
<ip interface="my_variable" interface_type="variable">192.168.0.1</ip>
```
Attention, la variable doit être de type "string".
## Désactiver la génération d'une IP ## Désactiver la génération d'une IP
@ -67,11 +29,12 @@ Il est possible de définir une [condition](../condition/README.md) de type "dis
``` ```
<services> <services>
<service name="test"> <service name="test">
<ip interface="ens3" iplist="test_ip">192.168.0.1</ip> <ip iplist="test_ip">variable_ip</ip>
</service> </service>
</services> </services>
<variables> <variables>
<variable name="condition" type="boolean"/> <variable name="condition" type="boolean"/>
<variable name="variable_ip" type="ip"/>
</variables> </variables>
<constraints> <constraints>
<condition name="disabled_if_in" source="condition"> <condition name="disabled_if_in" source="condition">

View File

@ -202,10 +202,10 @@ class ServiceAnnotator:
if type_ == 'symlink': if type_ == 'symlink':
variable.opt = self.objectspace.paths.get_variable(value) variable.opt = self.objectspace.paths.get_variable(value)
variable.multi = None variable.multi = None
if self.objectspace.types[dtd_key_type] != 'variable' and \ needed_type = self.objectspace.types[dtd_key_type]
variable.opt.type != self.objectspace.types[dtd_key_type]: if needed_type != 'variable' and variable.opt.type != needed_type:
msg = _(f'"{key}" in "{elttype}" must be a variable with type ' msg = _(f'"{value}" in "{elttype}" must be a variable with type '
f'"{self.objectspace.types[dtd_key_type]}" not "{variable.opt.type}"') f'"{needed_type}" not "{variable.opt.type}"')
raise DictConsistencyError(msg, 58, elt.xmlfiles) raise DictConsistencyError(msg, 58, elt.xmlfiles)
else: else:
@ -245,3 +245,20 @@ class ServiceAnnotator:
msg = _(f'attribute "source" is mandatory for the file "{file_.name}" ' msg = _(f'attribute "source" is mandatory for the file "{file_.name}" '
f'"({service_name})"') f'"({service_name})"')
raise DictConsistencyError(msg, 34, file_.xmlfiles) raise DictConsistencyError(msg, 34, file_.xmlfiles)
def _update_ip(self,
ip,
service_name,
) -> None:
variable = self.objectspace.paths.get_variable(ip.name)
if variable.type in ['ip', 'network_cidr'] and hasattr(ip, 'netmask'):
msg = _(f'ip with ip_type "{variable.type}" must not have netmask')
raise DictConsistencyError(msg, 59, ip.xmlfiles)
if variable.type == 'network' and not hasattr(ip, 'netmask'):
msg = _(f'ip with ip_type "{variable.type}" must have netmask')
raise DictConsistencyError(msg, 64, ip.xmlfiles)
if hasattr(ip, 'netmask'):
netmask = self.objectspace.paths.get_variable(ip.netmask)
if netmask.type != 'netmask':
msg = _(f'netmask in ip must have type "netmask", not "{netmask.type}"')
raise DictConsistencyError(msg, 65, ip.xmlfiles)

View File

@ -56,11 +56,9 @@
<!ELEMENT ip (#PCDATA)> <!ELEMENT ip (#PCDATA)>
<!ATTLIST ip iplist CDATA #IMPLIED> <!ATTLIST ip iplist CDATA #IMPLIED>
<!ATTLIST ip ip_type (network|variable) "network"> <!ATTLIST ip ip_type (variable) "variable">
<!ATTLIST ip interface_type (string|variable) "string"> <!ATTLIST ip netmask_type (variable) "variable">
<!ATTLIST ip interface CDATA #REQUIRED> <!ATTLIST ip netmask CDATA #IMPLIED>
<!ATTLIST ip netmask_type (netmask|variable) "netmask">
<!ATTLIST ip netmask CDATA "255.255.255.255">
<!ELEMENT file EMPTY> <!ELEMENT file EMPTY>
<!ATTLIST file name CDATA #REQUIRED> <!ATTLIST file name CDATA #REQUIRED>

View File

@ -1 +0,0 @@
{"rougail.general.mode_conteneur_actif": "oui", "rougail.general.nut_monitor_netmask.nut_monitor_netmask": [], "services.ntp.ips.nut_monitor_host.interface": "auto", "services.ntp.ips.nut_monitor_host.name": [], "services.ntp.ips.nut_monitor_host.netmask": [], "services.ntp.ips.nut_monitor_host.activate": true}

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='testsrv'>
<ip interface='eth0'>192.168.1.1</ip>
</service>
</services>
<variables>
<family name='général'>
<variable name='mode_conteneur_actif' type='string' description="No change" hidden="True">
<value>oui</value>
</variable>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1 +0,0 @@
{"rougail.general.mode_conteneur_actif": "oui", "services.testsrv.ips.192_168_1_1.interface": "eth0", "services.testsrv.ips.192_168_1_1.name": "192.168.1.1", "services.testsrv.ips.192_168_1_1.netmask": "255.255.255.255", "services.testsrv.ips.192_168_1_1.activate": true}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='nut'>
<ip>nut_monitor_host</ip>
</service>
</services>
<variables>
<variable name="nut_monitor_host" type="ip" mandatory='True'/>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -0,0 +1 @@
{"rougail.nut_monitor_host": null, "services.nut.ips.nut_monitor_host.name": null, "services.nut.ips.nut_monitor_host.activate": true}

View File

@ -11,13 +11,11 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", allow_reserved=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_7 = StrOption(name="interface", doc="interface", default="auto") option_7 = SymLinkOption(name="name", opt=option_2)
option_8 = NetworkOption(name="name", doc="name", default="192.168.0.1") option_8 = BoolOption(name="activate", doc="activate", default=True)
option_9 = NetmaskOption(name="netmask", doc="netmask", default="255.255.255.255") option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8])
option_10 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("yes")})))
option_6 = OptionDescription(name="192_168_0_1", doc="192.168.0.1", children=[option_7, option_8, option_9, option_10])
option_5 = OptionDescription(name="ips", doc="ips", children=[option_6]) option_5 = OptionDescription(name="ips", doc="ips", children=[option_6])
option_4 = OptionDescription(name="nut", doc="nut", children=[option_5]) option_4 = OptionDescription(name="nut", doc="nut", children=[option_5])
option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='nut'>
<ip >nut_monitor_host</ip>
</service>
</services>
<variables>
<variable name="nut_monitor_host" type="network_cidr" mandatory='True'/>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -0,0 +1 @@
{"rougail.nut_monitor_host": null, "services.nut.ips.nut_monitor_host.name": null, "services.nut.ips.nut_monitor_host.activate": true}

View File

@ -11,13 +11,11 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_2 = StrOption(name="condition", doc="condition", default="yes", properties=frozenset({"mandatory", "normal"})) option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", cidr=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_7 = StrOption(name="interface", doc="interface", default="auto") option_7 = SymLinkOption(name="name", opt=option_2)
option_8 = NetworkOption(name="name", doc="name", default="192.168.0.1") option_8 = BoolOption(name="activate", doc="activate", default=True)
option_9 = NetmaskOption(name="netmask", doc="netmask", default="255.255.255.255") option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8])
option_10 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("yes")})))
option_6 = OptionDescription(name="192_168_0_1", doc="192.168.0.1", children=[option_7, option_8, option_9, option_10])
option_5 = OptionDescription(name="ips", doc="ips", children=[option_6]) option_5 = OptionDescription(name="ips", doc="ips", children=[option_6])
option_4 = OptionDescription(name="nut", doc="nut", children=[option_5]) option_4 = OptionDescription(name="nut", doc="nut", children=[option_5])
option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))

View File

@ -3,19 +3,21 @@
<rougail version="0.9"> <rougail version="0.9">
<services> <services>
<service name='nut'> <service name='nut'>
<ip interface='auto' iplist="example">192.168.0.1</ip> <ip iplist="example">nut_monitor_host</ip>
</service> </service>
</services> </services>
<variables> <variables>
<variable name="condition"> <variable name="condition">
<value>no</value> <value>no</value>
</variable> </variable>
<variable name="nut_monitor_host" type="network_cidr" mandatory='True'/>
</variables> </variables>
<constraints> <constraints>
<condition name="disabled_if_in" source="condition"> <condition name="disabled_if_in" source="condition">
<param>yes</param> <param>yes</param>
<target type="iplist">example</target> <target type="iplist">example</target>
<target>nut_monitor_host</target>
</condition> </condition>
</constraints> </constraints>
</rougail> </rougail>

View File

@ -0,0 +1 @@
{"rougail.condition": "no", "rougail.nut_monitor_host": null, "services.nut.ips.nut_monitor_host.name": null, "services.nut.ips.nut_monitor_host.activate": true}

View File

@ -0,0 +1,23 @@
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
from tiramisu import *
option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"}))
option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", cidr=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True), 'expected': ParamValue("yes")}))}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_8 = SymLinkOption(name="name", opt=option_3)
option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("yes")})))
option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9])
option_6 = OptionDescription(name="ips", doc="ips", children=[option_7])
option_5 = OptionDescription(name="nut", doc="nut", children=[option_6])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -3,13 +3,14 @@
<rougail version="0.9"> <rougail version="0.9">
<services> <services>
<service name='nut'> <service name='nut'>
<ip interface='auto' iplist="example">192.168.0.1</ip> <ip iplist="example">nut_monitor_host</ip>
</service> </service>
</services> </services>
<variables> <variables>
<variable name="condition"> <variable name="condition">
<value>yes</value> <value>yes</value>
</variable> </variable>
<variable name="nut_monitor_host" type="network_cidr" mandatory='True'/>
</variables> </variables>
<constraints> <constraints>

View File

@ -0,0 +1 @@
{"rougail.condition": "yes", "rougail.nut_monitor_host": null, "services.nut.ips.nut_monitor_host.name": null, "services.nut.ips.nut_monitor_host.activate": false}

View File

@ -0,0 +1,23 @@
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
from tiramisu import *
option_2 = StrOption(name="condition", doc="condition", default="yes", properties=frozenset({"mandatory", "normal"}))
option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", cidr=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_8 = SymLinkOption(name="name", opt=option_3)
option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("yes")})))
option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9])
option_6 = OptionDescription(name="ips", doc="ips", children=[option_7])
option_5 = OptionDescription(name="nut", doc="nut", children=[option_6])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -4,7 +4,7 @@
<services> <services>
<service name='ntp'> <service name='ntp'>
<ip interface='auto' netmask='nut_monitor_netmask' netmask_type='variable' ip_type='variable'>nut_monitor_host</ip> <ip netmask='nut_monitor_netmask'>nut_monitor_host</ip>
</service> </service>
</services> </services>

View File

@ -0,0 +1 @@
{"rougail.general.mode_conteneur_actif": "oui", "rougail.general.nut_monitor_netmask.nut_monitor_netmask": [], "services.ntp.ips.nut_monitor_host.name": [], "services.ntp.ips.nut_monitor_host.netmask": [], "services.ntp.ips.nut_monitor_host.activate": true}

View File

@ -17,11 +17,10 @@ option_6 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de
option_4 = Leadership(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", children=[option_5, option_6], properties=frozenset({"basic"})) option_4 = Leadership(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", children=[option_5, option_6], properties=frozenset({"basic"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"})) option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_11 = StrOption(name="interface", doc="interface", default="auto") option_11 = SymLinkOption(name="name", opt=option_6)
option_12 = SymLinkOption(name="name", opt=option_6) option_12 = SymLinkOption(name="netmask", opt=option_5)
option_13 = SymLinkOption(name="netmask", opt=option_5) option_13 = BoolOption(name="activate", doc="activate", default=True)
option_14 = BoolOption(name="activate", doc="activate", default=True) option_10 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_11, option_12, option_13])
option_10 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_11, option_12, option_13, option_14])
option_9 = OptionDescription(name="ips", doc="ips", children=[option_10]) option_9 = OptionDescription(name="ips", doc="ips", children=[option_10])
option_8 = OptionDescription(name="ntp", doc="ntp", children=[option_9]) option_8 = OptionDescription(name="ntp", doc="ntp", children=[option_9])
option_7 = OptionDescription(name="services", doc="services", children=[option_8], properties=frozenset({"hidden"})) option_7 = OptionDescription(name="services", doc="services", children=[option_8], properties=frozenset({"hidden"}))

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='nut'>
<ip netmask='nut_monitor_netmask'>nut_monitor_host</ip>
</service>
</services>
<variables>
<variable name="nut_monitor_netmask" type="netmask" mandatory='True'/>
<variable name="nut_monitor_host" type="network" mandatory='True'/>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -0,0 +1 @@
{"rougail.nut_monitor_netmask": null, "rougail.nut_monitor_host": null, "services.nut.ips.nut_monitor_host.name": null, "services.nut.ips.nut_monitor_host.netmask": null, "services.nut.ips.nut_monitor_host.activate": true}

View File

@ -11,15 +11,14 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_2 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_8 = StrOption(name="interface", doc="interface", default="eth0") option_8 = SymLinkOption(name="name", opt=option_3)
option_9 = NetworkOption(name="name", doc="name", default="192.168.1.1") option_9 = SymLinkOption(name="netmask", opt=option_2)
option_10 = NetmaskOption(name="netmask", doc="netmask", default="255.255.255.255") option_10 = BoolOption(name="activate", doc="activate", default=True)
option_11 = BoolOption(name="activate", doc="activate", default=True) option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9, option_10])
option_7 = OptionDescription(name="192_168_1_1", doc="192.168.1.1", children=[option_8, option_9, option_10, option_11])
option_6 = OptionDescription(name="ips", doc="ips", children=[option_7]) option_6 = OptionDescription(name="ips", doc="ips", children=[option_7])
option_5 = OptionDescription(name="testsrv", doc="testsrv", children=[option_6]) option_5 = OptionDescription(name="nut", doc="nut", children=[option_6])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='nut'>
<ip interface='auto' netmask='nut_monitor_netmask' netmask_type='variable' ip_type='variable'>nut_monitor_host</ip>
</service>
</services>
<variables>
<family name='général'>
<variable name='mode_conteneur_actif' type='string' description="No change" hidden="True">
<value>oui</value>
</variable>
<variable name="nut_monitor_netmask" type="netmask" description="Masque de l'IP du réseau de l'esclave" mandatory='True'/>
<variable name="nut_monitor_host" type="network" description="Adresse IP du réseau de l'esclave" mandatory='True'/>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1 +0,0 @@
{"rougail.general.mode_conteneur_actif": "oui", "rougail.general.nut_monitor_netmask": null, "rougail.general.nut_monitor_host": null, "services.nut.ips.nut_monitor_host.interface": "auto", "services.nut.ips.nut_monitor_host.name": null, "services.nut.ips.nut_monitor_host.netmask": null, "services.nut.ips.nut_monitor_host.activate": true}

View File

@ -1,27 +0,0 @@
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
from tiramisu import *
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_4 = NetmaskOption(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", properties=frozenset({"basic", "mandatory"}))
option_5 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de l'esclave", properties=frozenset({"basic", "mandatory"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4, option_5], properties=frozenset({"basic"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_10 = StrOption(name="interface", doc="interface", default="auto")
option_11 = SymLinkOption(name="name", opt=option_5)
option_12 = SymLinkOption(name="netmask", opt=option_4)
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_9 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_10, option_11, option_12, option_13])
option_8 = OptionDescription(name="ips", doc="ips", children=[option_9])
option_7 = OptionDescription(name="nut", doc="nut", children=[option_8])
option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6])

View File

@ -1 +0,0 @@
{"rougail.condition": "no", "services.nut.ips.192_168_0_1.interface": "auto", "services.nut.ips.192_168_0_1.name": "192.168.0.1", "services.nut.ips.192_168_0_1.netmask": "255.255.255.255", "services.nut.ips.192_168_0_1.activate": true}

View File

@ -1 +0,0 @@
{"rougail.condition": "yes", "services.nut.ips.192_168_0_1.interface": "auto", "services.nut.ips.192_168_0_1.name": "192.168.0.1", "services.nut.ips.192_168_0_1.netmask": "255.255.255.255", "services.nut.ips.192_168_0_1.activate": false}

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='nut'>
<ip ip_type='variable' netmask="nut_monitor_netmask">nut_monitor_host</ip>
</service>
</services>
<variables>
<variable name="nut_monitor_host" type="network_cidr" mandatory='True'/>
<variable name="nut_monitor_netmask" type="netmask" mandatory='True'/>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='nut'>
<ip netmask="nut_monitor_netmask">nut_monitor_host</ip>
</service>
</services>
<variables>
<variable name="nut_monitor_host" type="ip" mandatory='True'/>
<variable name="nut_monitor_netmask" type="netmask" mandatory='True'/>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='nut'>
<ip>nut_monitor_host</ip>
</service>
</services>
<variables>
<variable name="nut_monitor_host" type="network" mandatory='True'/>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='nut'>
<ip netmask='nut_monitor_netmask'>nut_monitor_host</ip>
</service>
</services>
<variables>
<variable name="nut_monitor_host" type="network" mandatory='True'/>
<variable name="nut_monitor_netmask" type="ip" mandatory='True'/>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->