instance.cfg.in 9.01 KB
Newer Older
1 2 3 4 5 6 7
[buildout]
parts =
  switch-softwaretype

eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}

8 9
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
10 11 12 13 14 15 16 17 18 19 20
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}

[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extra-context =
context =
21 22
    key ipv4_set slap-configuration:ipv4
    key ipv6_set slap-configuration:ipv6
23 24
    key eggs_directory buildout:eggs-directory
    key develop_eggs_directory buildout:develop-eggs-directory
25 26 27
    key slap_software_type slap-configuration:slap-software-type
    key slapparameter_dict slap-configuration:configuration
    key computer_id slap-configuration:computer
28
    raw slapos_core_version {{ slapos_core_version }}
29 30 31
    ${:extra-context}

[dynamic-template-cloudooo-parameters]
32 33 34
cups = {{ cups_location }}
dbus = {{ dbus_location }}
dbus-glib = {{ dbus_glib_location }}
35 36 37
file = {{ file_location }}
fontconfig = {{ fontconfig_location }}
freetype = {{ freetype_location }}
38
glib = {{ glib_location }}
39
libffi = {{ libffi_location }}
40 41 42 43 44 45 46 47 48 49 50 51 52
libICE = {{ libICE_location }}
libpng12 = {{ libpng12_location }}
libSM = {{ libSM_location }}
libX11 = {{ libX11_location }}
libXau = {{ libXau_location }}
libXdmcp = {{ libXdmcp_location }}
libXext = {{ libXext_location }}
libxcb = {{ libxcb_location }}
libXrender = {{ libXrender_location }}
zlib = {{ zlib_location }}
libreoffice-bin = {{ libreoffice_bin_location }}
fonts = {{ fonts_location }}
buildout-bin-directory = {{ buildout_bin_directory }}
53 54
6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }}
55 56 57

[dynamic-template-cloudooo]
< = jinja2-template-base
58
template = {{ template_cloudooo }}
59 60 61 62 63
filename = instance-cloudoo.cfg
extra-context =
    section parameter_dict dynamic-template-cloudooo-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
    raw software_type cloudooo
64
[dynamic-template-erp5-parameters]
65 66
local-bt5-repository = {{ local_bt5_repository }}

67
[dynamic-template-erp5]
68
< = jinja2-template-base
69 70
template = {{ template_erp5 }}
filename = instance-erp5.cfg
71
extensions = jinja2.ext.do
72
extra-context =
73
    key local_bt5_repository dynamic-template-erp5-parameters:local-bt5-repository
Alain Takoudjou's avatar
Alain Takoudjou committed
74
    key openssl_location :openssl-location
75
# Must match the key id in [switch-softwaretype] which uses this section.
76 77
    key software_type :software-type
software-type = default
Alain Takoudjou's avatar
Alain Takoudjou committed
78
openssl-location = {{ openssl_location }}
79 80 81 82

[dynamic-template-erp5-RootSoftwareInstance]
< = dynamic-template-erp5
software-type = RootSoftwareInstance
83

84 85 86 87
[dynamic-template-erp5-create-erp5-site]
< = dynamic-template-erp5
software-type = create-erp5-site

88 89 90 91 92 93 94 95
[dynamic-template-balancer-parameters]
apache = {{ apache_location }}
openssl = {{ openssl_location }}
haproxy = {{ haproxy_location }}
instance-logrotate-cfg = {{ template_logrotate_base }}
bin-directory = {{ bin_directory }}
6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }}
96
template-haproxy-cfg = {{ template_haproxy_cfg }}
97
template-apache-conf = {{ template_apache_conf }}
98 99 100 101 102 103 104 105 106 107 108

[dynamic-template-balancer]
< = jinja2-template-base
template = {{ template_balancer }}
extensions = jinja2.ext.do
filename = instance-balancer.cfg
extra-context =
    section parameter_dict dynamic-template-balancer-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
    raw software_type balancer

109 110
[dynamic-template-neo]
< = jinja2-template-base
111
template = {{ template_neo }}
112 113 114 115 116 117
filename = instance-neo.cfg
extensions = jinja2.ext.do
extra-context =
# Must match the key id in [switch-softwaretype] which uses this section.
    raw software_type zodb-neo

118 119 120 121 122
[dynamic-template-zeo-parameters]
buildout-bin-directory = {{ buildout_bin_directory }}
instance-logrotate-cfg = {{ template_logrotate_base }}
6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }}
123
findutils-location = {{ findutils_location }}
124 125 126 127 128 129 130 131 132 133 134 135 136

[dynamic-template-zeo]
< = jinja2-template-base
template = {{ template_zeo }}
filename = instance-zeo.cfg
extensions = jinja2.ext.do
extra-context =
    key buildout_directory buildout:directory
    section parameter_dict dynamic-template-zeo-parameters
    import json_module json
# Must match the key id in [switch-softwaretype] which uses this section.
    raw software_type zodb-zeo

137
[dynamic-template-zope-parameters]
138
bin-directory = {{ bin_directory }}
139 140 141 142 143 144
zope-conf-template = {{ template_zope_conf }}
instance-logrotate-cfg = {{ template_logrotate_base }}
buildout-bin-directory = {{ buildout_bin_directory }}
6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }}
jsl = {{ jsl_location }}
145
link-binary = {{ dumps(zope_link_binary) }}
146
userhosts = {{ userhosts_location }}
147
runzope-userhosts-preloaded-template = {{ template_runzope_userhosts_preloaded }}
148

149
[dynamic-template-zope]
150
< = jinja2-template-base
151 152
template = {{ template_zope }}
filename = instance-zope.cfg
153 154 155
extensions = jinja2.ext.do
extra-context =
    key buildout_directory buildout:directory
156
    section parameter_dict dynamic-template-zope-parameters
157
    import urlparse urlparse
158
# Must match the key id in [switch-softwaretype] which uses this section.
159 160 161 162 163 164
    key software_type :software-type
software-type = zope

[dynamic-template-cluster-zope]
< = dynamic-template-zope
software-type = cluster-zope
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190

[dynamic-template-kumofs-parameters]
dash-location = {{ dash_location }}
dcron-location = {{ dcron_location }}
gzip-location = {{ gzip_location }}
kumo-location = {{ kumo_location }}
logrotate-location = {{ logrotate_location }}

[dynamic-template-kumofs]
< = jinja2-template-base
template = {{ template_kumofs }}
filename = instance-kumofs.cfg
extra-context =
    section parameter_dict dynamic-template-kumofs-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
    raw software_type kumofs

[dynamic-template-mariadb-parameters]
coreutils-location = {{ coreutils_location }}
dcron-location = {{ dcron_location }}
findutils-location = {{ findutils_location }}
gzip-location = {{ gzip_location }}
logrotate-location = {{ logrotate_location }}
mariadb-location = {{ mariadb_location }}
template-my-cnf = {{ template_my_cnf }}
template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
191
link-binary = {{ dumps(mariadb_link_binary) }}
192
instance-logrotate-cfg = {{ template_logrotate_base }}
193 194 195 196 197 198 199 200 201 202

[dynamic-template-mariadb]
< = jinja2-template-base
template = {{ template_mariadb }}
filename = instance-mariadb.cfg
extensions = jinja2.ext.do
extra-context =
    section parameter_dict dynamic-template-mariadb-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
    raw software_type mariadb
203

204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
[dynamic-template-create-erp5-site-parameters]
instance-erp5 = ${dynamic-template-erp5-create-erp5-site:rendered}
template-create-erp5-site-real = {{ template_create_erp5_site_real }}
dash-location = {{ dash_location }}
curl-location = {{ curl_location }}

[dynamic-template-create-erp5-site]
< = jinja2-template-base
template = {{ template_create_erp5_site }}
filename = instance-create-erp5-site.cfg
extra-context =
    section parameter_dict dynamic-template-create-erp5-site-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
    raw software_type create-erp5-site

219
[switch-softwaretype]
220 221 222 223 224 225 226 227 228 229
recipe = slapos.recipe.build
script =
  import subprocess, sys
  software_type = self.buildout["slap-configuration"]["slap-software-type"]
  # XXX-Antoine: We gotta find a better way to do this. I tried to check
  # out how slapgrid-cp was running buildout. But it is worse than that.
  args = sys.argv[:]
  args += map("slap-connection:%%s=%%s".__mod__,
              self.buildout["slap-connection"].iteritems())
  args += ("buildout:directory=${buildout:directory}",
230 231 232
           "buildout:installed=.installed-${:_buildout_section_name_}.cfg")
  buildout = self.options[software_type]
  # Options.get (from zc.buildout) should deserialize.
233
  try: override = open(self.options["override"][software_type]).read()
234
  except (KeyError, TypeError): pass
235 236 237 238
  else: \
    override = "[buildout]\nextends = %%s\n\n" %% buildout + override; \
    buildout = "${buildout:parts-directory}/${:_buildout_section_name_}.cfg"; \
    open(buildout, "w", 0).write(override)
239
  subprocess.check_call(args + ["-oc", buildout])
240 241 242
update_script = ${:script}
slapos_promise =
slapos_update_promise = ${:slapos_promise}
243
override = {{ dumps(override_switch_softwaretype |default) }}
244

245
# Public software types
246
default = ${dynamic-template-erp5:rendered}
247
create-erp5-site = ${dynamic-template-create-erp5-site:rendered}
248 249
# BBB: Legacy software types, aliased to "default"
RootSoftwareInstance = ${dynamic-template-erp5-RootSoftwareInstance:rendered}
250
# Internal software types
251
kumofs = ${dynamic-template-kumofs:rendered}
252
cloudooo = ${dynamic-template-cloudooo:rendered}
253 254
mariadb = ${dynamic-template-mariadb:rendered}
balancer = ${dynamic-template-balancer:rendered}
255
zodb-neo = ${dynamic-template-neo:rendered}
256
zodb-zeo = ${dynamic-template-zeo:rendered}
257
zope = ${dynamic-template-zope:rendered}