separate RougailTemplate to RougailSystemdTemplate

This commit is contained in:
2021-02-20 15:46:13 +01:00
parent ba41b27dbf
commit eb3720d6bf
76 changed files with 313 additions and 427 deletions

View File

@ -0,0 +1,2 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -

View File

@ -0,0 +1,2 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -

View File

@ -0,0 +1,2 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -

View File

@ -0,0 +1,2 @@
C /etc/systemd-makefs@dev-disk-by\x2dpartlabel 0644 root root - /usr/local/lib/etc/systemd-makefs@dev-disk-by\x2dpartlabel
z /etc/systemd-makefs@dev-disk-by\x2dpartlabel - - - - -

View File

@ -0,0 +1,2 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -

View File

@ -0,0 +1,2 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -

View File

@ -1 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test_service.engine": "creole", "services.test.overrides.test_service.group": "root", "services.test.overrides.test_service.mode": "0644", "services.test.overrides.test_service.name": "/systemd/system/test.service.d/rougail.conf", "services.test.overrides.test_service.owner": "root", "services.test.overrides.test_service.source": "test.service", "services.test.overrides.test_service.activate": true}
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test_service.engine": "creole", "services.test.overrides.test_service.name": "test", "services.test.overrides.test_service.source": "test.service", "services.test.overrides.test_service.activate": true}

View File

@ -15,13 +15,10 @@ option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non"
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="mode", doc="mode", default="0644")
option_11 = StrOption(name="name", doc="name", default="/systemd/system/test.service.d/rougail.conf")
option_12 = StrOption(name="owner", doc="owner", default="root")
option_13 = StrOption(name="source", doc="source", default="test.service")
option_14 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14])
option_9 = StrOption(name="name", doc="name", default="test")
option_10 = StrOption(name="source", doc="source", default="test.service")
option_11 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_9, option_10, option_11])
option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7])
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))

View File

@ -1 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test_service.engine": "none", "services.test.overrides.test_service.group": "root", "services.test.overrides.test_service.mode": "0644", "services.test.overrides.test_service.name": "/systemd/system/test.service.d/rougail.conf", "services.test.overrides.test_service.owner": "root", "services.test.overrides.test_service.source": "test.service", "services.test.overrides.test_service.activate": true}
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test_service.engine": "none", "services.test.overrides.test_service.name": "test", "services.test.overrides.test_service.source": "test.service", "services.test.overrides.test_service.activate": true}

View File

@ -15,13 +15,10 @@ option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non"
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="engine", doc="engine", default="none")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="mode", doc="mode", default="0644")
option_11 = StrOption(name="name", doc="name", default="/systemd/system/test.service.d/rougail.conf")
option_12 = StrOption(name="owner", doc="owner", default="root")
option_13 = StrOption(name="source", doc="source", default="test.service")
option_14 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14])
option_9 = StrOption(name="name", doc="name", default="test")
option_10 = StrOption(name="source", doc="source", default="test.service")
option_11 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_9, option_10, option_11])
option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7])
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))

View File

@ -1 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test2_service.engine": "creole", "services.test.overrides.test2_service.group": "root", "services.test.overrides.test2_service.mode": "0644", "services.test.overrides.test2_service.name": "/systemd/system/test.service.d/rougail.conf", "services.test.overrides.test2_service.owner": "root", "services.test.overrides.test2_service.source": "test2.service", "services.test.overrides.test2_service.activate": true}
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test2_service.engine": "creole", "services.test.overrides.test2_service.name": "test", "services.test.overrides.test2_service.source": "test2.service", "services.test.overrides.test2_service.activate": true}

View File

@ -15,13 +15,10 @@ option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non"
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="mode", doc="mode", default="0644")
option_11 = StrOption(name="name", doc="name", default="/systemd/system/test.service.d/rougail.conf")
option_12 = StrOption(name="owner", doc="owner", default="root")
option_13 = StrOption(name="source", doc="source", default="test2.service")
option_14 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="test2_service", doc="test2.service", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14])
option_9 = StrOption(name="name", doc="name", default="test")
option_10 = StrOption(name="source", doc="source", default="test2.service")
option_11 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="test2_service", doc="test2.service", children=[option_8, option_9, option_10, option_11])
option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7])
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))

View File

@ -0,0 +1,2 @@
C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname
z /etc/mailname - - - - -

View File

@ -0,0 +1,2 @@
C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname
z /etc/mailname - - - - -

View File

@ -0,0 +1,2 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -

View File

@ -0,0 +1,2 @@
C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname
z /etc/mailname - - - - -

View File

@ -0,0 +1,2 @@
C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname
z /etc/mailname - - - - -

View File

@ -0,0 +1,4 @@
C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname
z /etc/mailname - - - - -
C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2
z /etc/mailname2 - - - - -

View File

@ -0,0 +1,4 @@
C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname
z /etc/mailname - - - - -
C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2
z /etc/mailname2 - - - - -

View File

@ -0,0 +1,2 @@
C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname
z /etc/mailname - - - - -

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='ntp'>
<port protocol='udp'>123</port>
</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.ntp.ports.123.name": "123", "services.ntp.ports.123.protocol": "udp", "services.ntp.ports.123.activate": true}

View File

@ -1,24 +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_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = PortOption(name="name", doc="name", default="123", allow_private=True)
option_9 = StrOption(name="protocol", doc="protocol", default="udp")
option_10 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="123", doc="123", children=[option_8, option_9, option_10])
option_6 = OptionDescription(name="ports", doc="ports", children=[option_7])
option_5 = OptionDescription(name="ntp", doc="ntp", 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

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='ntp'>
<port protocol='udp' port_type="variable" portlist="example">my_variable</port>
<port protocol='tcp' port_type="variable" portlist="example">my_variable</port>
</service>
</services>
<variables>
<variable name='my_variable' type='port'>
<value>123</value>
</variable>
</variables>
<constraints>
<condition name="disabled_if_in" source="my_variable">
<param type='nil'/>
<target type="portlist">example</target>
</condition>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1 +0,0 @@
{"rougail.my_variable": "123", "services.ntp.ports.my_variable.name": "123", "services.ntp.ports.my_variable.protocol": "udp", "services.ntp.ports.my_variable.activate": true, "services.ntp.ports.my_variable_1.name": "123", "services.ntp.ports.my_variable_1.protocol": "tcp", "services.ntp.ports.my_variable_1.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_2 = PortOption(name="my_variable", doc="my_variable", default="123", allow_private=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_7 = SymLinkOption(name="name", opt=option_2)
option_8 = StrOption(name="protocol", doc="protocol", default="udp")
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(None)})))
option_6 = OptionDescription(name="my_variable", doc="my_variable", children=[option_7, option_8, option_9])
option_11 = SymLinkOption(name="name", opt=option_2)
option_12 = StrOption(name="protocol", doc="protocol", default="tcp")
option_13 = 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(None)})))
option_10 = OptionDescription(name="my_variable_1", doc="my_variable_1", children=[option_11, option_12, option_13])
option_5 = OptionDescription(name="ports", doc="ports", children=[option_6, option_10])
option_4 = OptionDescription(name="ntp", doc="ntp", children=[option_5])
option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3])

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<variables>
<variable name='my_variable' type='port'>
<value>123</value>
</variable>
</variables>
<constraints>
<condition name="disabled_if_in" source="my_variable">
<param type='nil'/>
<target type="portlist" optional="True">example</target>
</condition>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1 +0,0 @@
{"rougail.my_variable": "123"}

View File

@ -1,16 +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_2 = PortOption(name="my_variable", doc="my_variable", default="123", allow_private=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='ntp'>
<port protocol='udp' port_type="variable">my_variable</port>
<port protocol='tcp' port_type="variable">my_variable</port>
</service>
</services>
<variables>
<variable name='my_variable' type='port'>
<value>123</value>
</variable>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1 +0,0 @@
{"rougail.my_variable": "123", "services.ntp.ports.my_variable.name": "123", "services.ntp.ports.my_variable.protocol": "udp", "services.ntp.ports.my_variable.activate": true, "services.ntp.ports.my_variable_1.name": "123", "services.ntp.ports.my_variable_1.protocol": "tcp", "services.ntp.ports.my_variable_1.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_2 = PortOption(name="my_variable", doc="my_variable", default="123", allow_private=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_7 = SymLinkOption(name="name", opt=option_2)
option_8 = StrOption(name="protocol", doc="protocol", default="udp")
option_9 = BoolOption(name="activate", doc="activate", default=True)
option_6 = OptionDescription(name="my_variable", doc="my_variable", children=[option_7, option_8, option_9])
option_11 = SymLinkOption(name="name", opt=option_2)
option_12 = StrOption(name="protocol", doc="protocol", default="tcp")
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_10 = OptionDescription(name="my_variable_1", doc="my_variable_1", children=[option_11, option_12, option_13])
option_5 = OptionDescription(name="ports", doc="ports", children=[option_6, option_10])
option_4 = OptionDescription(name="ntp", doc="ntp", children=[option_5])
option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3])

View File

@ -1 +1 @@
{"rougail.nut_monitor_host": "192.168.0.1", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.engine": "creole", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.group": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.mode": "0644", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.name": "/systemd/system/nut.service.d/rougail_ip.conf", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.network": "192.168.0.1", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.owner": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.activate": true}
{"rougail.nut_monitor_host": "192.168.0.1", "services.nut.ip.nut_monitor_host.name": "192.168.0.1", "services.nut.ip.nut_monitor_host.activate": true}

View File

@ -13,14 +13,9 @@ except:
from tiramisu import *
option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_7 = StrOption(name="engine", doc="engine", default="creole")
option_8 = StrOption(name="group", doc="group", default="root")
option_9 = StrOption(name="mode", doc="mode", default="0644")
option_10 = FilenameOption(name="name", doc="name", default="/systemd/system/nut.service.d/rougail_ip.conf")
option_11 = SymLinkOption(name="network", opt=option_2)
option_12 = StrOption(name="owner", doc="owner", default="root")
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_6 = OptionDescription(name="/systemd/system/nut_service_d/rougail_ip_conf", doc="/systemd/system/nut.service.d/rougail_ip.conf", children=[option_7, option_8, option_9, option_10, option_11, option_12, option_13])
option_7 = SymLinkOption(name="name", opt=option_2)
option_8 = BoolOption(name="activate", doc="activate", default=True)
option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8])
option_5 = OptionDescription(name="ip", doc="ip", children=[option_6])
option_4 = OptionDescription(name="nut", doc="nut", children=[option_5])
option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))

View File

@ -1 +1 @@
{"rougail.nut_monitor_host": "192.168.0.0/24", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.engine": "creole", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.group": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.mode": "0644", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.name": "/systemd/system/nut.service.d/rougail_ip.conf", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.network": "192.168.0.0/24", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.owner": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.activate": true}
{"rougail.nut_monitor_host": "192.168.0.0/24", "services.nut.ip.nut_monitor_host.name": "192.168.0.0/24", "services.nut.ip.nut_monitor_host.activate": true}

View File

@ -13,14 +13,9 @@ except:
from tiramisu import *
option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_7 = StrOption(name="engine", doc="engine", default="creole")
option_8 = StrOption(name="group", doc="group", default="root")
option_9 = StrOption(name="mode", doc="mode", default="0644")
option_10 = FilenameOption(name="name", doc="name", default="/systemd/system/nut.service.d/rougail_ip.conf")
option_11 = SymLinkOption(name="network", opt=option_2)
option_12 = StrOption(name="owner", doc="owner", default="root")
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_6 = OptionDescription(name="/systemd/system/nut_service_d/rougail_ip_conf", doc="/systemd/system/nut.service.d/rougail_ip.conf", children=[option_7, option_8, option_9, option_10, option_11, option_12, option_13])
option_7 = SymLinkOption(name="name", opt=option_2)
option_8 = BoolOption(name="activate", doc="activate", default=True)
option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8])
option_5 = OptionDescription(name="ip", doc="ip", children=[option_6])
option_4 = OptionDescription(name="nut", doc="nut", children=[option_5])
option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))

View File

@ -1 +1 @@
{"rougail.condition": "no", "rougail.nut_monitor_host": "192.168.0.0/24", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.engine": "creole", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.group": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.mode": "0644", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.name": "/systemd/system/nut.service.d/rougail_ip.conf", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.network": "192.168.0.0/24", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.owner": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.activate": true}
{"rougail.condition": "no", "rougail.nut_monitor_host": "192.168.0.0/24", "services.nut.ip.nut_monitor_host.name": "192.168.0.0/24", "services.nut.ip.nut_monitor_host.activate": true}

View File

@ -14,14 +14,9 @@ except:
option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"}))
option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", 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 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="mode", doc="mode", default="0644")
option_11 = FilenameOption(name="name", doc="name", default="/systemd/system/nut.service.d/rougail_ip.conf")
option_12 = SymLinkOption(name="network", opt=option_3)
option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = 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="/systemd/system/nut_service_d/rougail_ip_conf", doc="/systemd/system/nut.service.d/rougail_ip.conf", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14])
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="ip", doc="ip", 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"}))

View File

@ -1 +1 @@
{"rougail.condition": "yes", "rougail.nut_monitor_host": "192.168.0.0/24", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.engine": "creole", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.group": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.mode": "0644", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.name": "/systemd/system/nut.service.d/rougail_ip.conf", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.network": "192.168.0.0/24", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.owner": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.activate": false}
{"rougail.condition": "yes", "rougail.nut_monitor_host": "192.168.0.0/24", "services.nut.ip.nut_monitor_host.name": "192.168.0.0/24", "services.nut.ip.nut_monitor_host.activate": false}

View File

@ -14,14 +14,9 @@ except:
option_2 = StrOption(name="condition", doc="condition", default="yes", properties=frozenset({"mandatory", "normal"}))
option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="mode", doc="mode", default="0644")
option_11 = FilenameOption(name="name", doc="name", default="/systemd/system/nut.service.d/rougail_ip.conf")
option_12 = SymLinkOption(name="network", opt=option_3)
option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = 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="/systemd/system/nut_service_d/rougail_ip_conf", doc="/systemd/system/nut.service.d/rougail_ip.conf", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14])
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="ip", doc="ip", 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"}))

View File

@ -1 +1 @@
{"rougail.general.nut_monitor_netmask.nut_monitor_netmask": [{"rougail.general.nut_monitor_netmask.nut_monitor_netmask": "255.255.255.0", "rougail.general.nut_monitor_netmask.nut_monitor_host": "192.168.1.0"}], "services.ntp.ip./systemd/system/ntp_service_d/rougail_ip_conf.engine": "creole", "services.ntp.ip./systemd/system/ntp_service_d/rougail_ip_conf.group": "root", "services.ntp.ip./systemd/system/ntp_service_d/rougail_ip_conf.mode": "0644", "services.ntp.ip./systemd/system/ntp_service_d/rougail_ip_conf.name": "/systemd/system/ntp.service.d/rougail_ip.conf", "services.ntp.ip./systemd/system/ntp_service_d/rougail_ip_conf.netmask": ["255.255.255.0"], "services.ntp.ip./systemd/system/ntp_service_d/rougail_ip_conf.network": ["192.168.1.0"], "services.ntp.ip./systemd/system/ntp_service_d/rougail_ip_conf.owner": "root", "services.ntp.ip./systemd/system/ntp_service_d/rougail_ip_conf.activate": true}
{"rougail.general.nut_monitor_netmask.nut_monitor_netmask": [{"rougail.general.nut_monitor_netmask.nut_monitor_netmask": "255.255.255.0", "rougail.general.nut_monitor_netmask.nut_monitor_host": "192.168.1.0"}], "services.ntp.ip.nut_monitor_host.name": ["192.168.1.0"], "services.ntp.ip.nut_monitor_host.netmask": ["255.255.255.0"], "services.ntp.ip.nut_monitor_host.activate": true}

View File

@ -16,15 +16,10 @@ option_5 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", multi=
option_3 = Leadership(name="nut_monitor_netmask", doc="nut_monitor_netmask", children=[option_4, option_5], properties=frozenset({"normal"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_10 = StrOption(name="engine", doc="engine", default="creole")
option_11 = StrOption(name="group", doc="group", default="root")
option_12 = StrOption(name="mode", doc="mode", default="0644")
option_13 = FilenameOption(name="name", doc="name", default="/systemd/system/ntp.service.d/rougail_ip.conf")
option_14 = SymLinkOption(name="netmask", opt=option_4)
option_15 = SymLinkOption(name="network", opt=option_5)
option_16 = StrOption(name="owner", doc="owner", default="root")
option_17 = BoolOption(name="activate", doc="activate", default=True)
option_9 = OptionDescription(name="/systemd/system/ntp_service_d/rougail_ip_conf", doc="/systemd/system/ntp.service.d/rougail_ip.conf", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17])
option_10 = SymLinkOption(name="name", opt=option_5)
option_11 = SymLinkOption(name="netmask", opt=option_4)
option_12 = 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_8 = OptionDescription(name="ip", doc="ip", children=[option_9])
option_7 = OptionDescription(name="ntp", doc="ntp", children=[option_8])
option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"}))

View File

@ -1 +1 @@
{"rougail.nut_monitor_host": ["192.168.0.1", "192.168.0.2"], "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.engine": "creole", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.group": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.mode": "0644", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.name": "/systemd/system/nut.service.d/rougail_ip.conf", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.network": ["192.168.0.1", "192.168.0.2"], "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.owner": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.activate": true}
{"rougail.nut_monitor_host": ["192.168.0.1", "192.168.0.2"], "services.nut.ip.nut_monitor_host.name": ["192.168.0.1", "192.168.0.2"], "services.nut.ip.nut_monitor_host.activate": true}

View File

@ -13,14 +13,9 @@ except:
from tiramisu import *
option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", multi=True, default=['192.168.0.1', '192.168.0.2'], default_multi="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_7 = StrOption(name="engine", doc="engine", default="creole")
option_8 = StrOption(name="group", doc="group", default="root")
option_9 = StrOption(name="mode", doc="mode", default="0644")
option_10 = FilenameOption(name="name", doc="name", default="/systemd/system/nut.service.d/rougail_ip.conf")
option_11 = SymLinkOption(name="network", opt=option_2)
option_12 = StrOption(name="owner", doc="owner", default="root")
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_6 = OptionDescription(name="/systemd/system/nut_service_d/rougail_ip_conf", doc="/systemd/system/nut.service.d/rougail_ip.conf", children=[option_7, option_8, option_9, option_10, option_11, option_12, option_13])
option_7 = SymLinkOption(name="name", opt=option_2)
option_8 = BoolOption(name="activate", doc="activate", default=True)
option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8])
option_5 = OptionDescription(name="ip", doc="ip", children=[option_6])
option_4 = OptionDescription(name="nut", doc="nut", children=[option_5])
option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))

View File

@ -1 +1 @@
{"rougail.nut_monitor_netmask": "255.255.255.0", "rougail.nut_monitor_host": "192.168.0.0", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.engine": "creole", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.group": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.mode": "0644", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.name": "/systemd/system/nut.service.d/rougail_ip.conf", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.netmask": "255.255.255.0", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.network": "192.168.0.0", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.owner": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.activate": true}
{"rougail.nut_monitor_netmask": "255.255.255.0", "rougail.nut_monitor_host": "192.168.0.0", "services.nut.ip.nut_monitor_host.name": "192.168.0.0", "services.nut.ip.nut_monitor_host.netmask": "255.255.255.0", "services.nut.ip.nut_monitor_host.activate": true}

View File

@ -14,15 +14,10 @@ except:
option_2 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", default="255.255.255.0", properties=frozenset({"mandatory", "normal"}))
option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0", properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="mode", doc="mode", default="0644")
option_11 = FilenameOption(name="name", doc="name", default="/systemd/system/nut.service.d/rougail_ip.conf")
option_12 = SymLinkOption(name="netmask", opt=option_2)
option_13 = SymLinkOption(name="network", opt=option_3)
option_14 = StrOption(name="owner", doc="owner", default="root")
option_15 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="/systemd/system/nut_service_d/rougail_ip_conf", doc="/systemd/system/nut.service.d/rougail_ip.conf", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15])
option_8 = SymLinkOption(name="name", opt=option_3)
option_9 = SymLinkOption(name="netmask", opt=option_2)
option_10 = 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_6 = OptionDescription(name="ip", doc="ip", 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"}))

View File

@ -1 +1 @@
{"rougail.nut_monitor_host": null, "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.engine": "creole", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.group": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.mode": "0644", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.name": "/systemd/system/nut.service.d/rougail_ip.conf", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.network": null, "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.owner": "root", "services.nut.ip./systemd/system/nut_service_d/rougail_ip_conf.activate": true}
{"rougail.nut_monitor_host": null, "services.nut.ip.nut_monitor_host.name": null, "services.nut.ip.nut_monitor_host.activate": true}

View File

@ -13,14 +13,9 @@ except:
from tiramisu import *
option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", allow_reserved=True, properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_7 = StrOption(name="engine", doc="engine", default="creole")
option_8 = StrOption(name="group", doc="group", default="root")
option_9 = StrOption(name="mode", doc="mode", default="0644")
option_10 = FilenameOption(name="name", doc="name", default="/systemd/system/nut.service.d/rougail_ip.conf")
option_11 = SymLinkOption(name="network", opt=option_2)
option_12 = StrOption(name="owner", doc="owner", default="root")
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_6 = OptionDescription(name="/systemd/system/nut_service_d/rougail_ip_conf", doc="/systemd/system/nut.service.d/rougail_ip.conf", children=[option_7, option_8, option_9, option_10, option_11, option_12, option_13])
option_7 = SymLinkOption(name="name", opt=option_2)
option_8 = BoolOption(name="activate", doc="activate", default=True)
option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8])
option_5 = OptionDescription(name="ip", doc="ip", children=[option_6])
option_4 = OptionDescription(name="nut", doc="nut", children=[option_5])
option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='ntp'>
<port protocol='udp' port_type="variable" portlist="example">my_variable</port>
<port protocol='tcp' port_type="variable" portlist="example">my_variable</port>
</service>
</services>
<variables>
<variable name='my_variable' type='port'>
<value>123</value>
</variable>
</variables>
<constraints>
<condition name="disabled_if_in" source="my_variable">
<param type='nil'/>
<param>aaa</param>
<target type="portlist">example</target>
</condition>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='ntp'>
<port protocol='udp' port_type="variable">my_variable</port>
<port protocol='tcp' port_type="variable">my_variable</port>
</service>
</services>
<variables>
<variable name='my_variable' type='string'>
<value>123</value>
</variable>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -2,7 +2,7 @@
<rougail version="0.9">
<services>
<service name='test' manage="False">
<port>10</port>
<override/>
</service>
</services>
<variables>

View File

@ -5,7 +5,7 @@ from pytest import fixture, mark
from lxml.etree import parse
from tiramisu import Config
from rougail import RougailConfig, RougailTemplate
from rougail import RougailConfig, RougailSystemdTemplate
template_dirs = 'tests/dictionaries'
@ -13,7 +13,9 @@ excludes = set([])
#excludes = set(['01base_file_utfchar'])
test_ok = {f for f in listdir(template_dirs) if not f.startswith('_') and isdir(join(template_dirs, f, 'tmpl'))}
test_ok -= excludes
#test_ok = ['40ifin_leadershipauto']
test_ok = list(test_ok)
test_ok.sort()
#test_ok = ['20override']
@fixture(scope="module", params=test_ok)
@ -63,7 +65,7 @@ async def test_dictionary(test_dir):
RougailConfig['tmp_dir'] = tmp_dir
RougailConfig['functions_file'] = funcs_file
RougailConfig['destinations_dir'] = dest_dir
engine = RougailTemplate(config)
engine = RougailSystemdTemplate(config)
await engine.instance_files()
list_templates = set()
if isdir(dest_dir):