Commit f5ebda78 authored by Thomas Leymonerie's avatar Thomas Leymonerie

Clean up slapos.recipe.template

Use slapos.recipe.template instead of slapos.recipe.template if possible

Harmonize template keys :
rendered -> output
template -> url
template = inline: -> inline =

Delete "mode" key

See merge request !1151
parent 08a696d4
Pipeline #21163 failed with stage
in 0 seconds
......@@ -60,17 +60,16 @@ eggs +=
# env.sh for ZODB's python to be on $PATH.
[ZODB-env.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = ${buildout:directory}/${:_buildout_section_name_}
inline =
export PS1="(ZODB-env) $PS1"
export PATH=${buildout:bin-directory}:$PATH
# .nxdtest to run ZODB tests
[.nxdtest]
<= jinja2-template
template =
inline:
inline =
# determine where ZODB & friends were installed
from subprocess import check_output
where = check_output(['python', '-c', """if 1:
......@@ -99,12 +98,12 @@ template =
# instance to run nxdtest.
[instance.cfg]
<= jinja2-template
template = inline:
inline =
[buildout]
extends = ${nxdtest-instance.cfg:rendered}
extends = ${nxdtest-instance.cfg:output}
[runTestSuite]
env.sh = ${ZODB-env.sh:rendered}
env.sh = ${ZODB-env.sh:output}
workdir = ${buildout:directory}
......
......@@ -18,8 +18,8 @@ md5sum = e5f4b1d997e50ffe4998c68c8ec45403
recipe = slapos.recipe.template:jinja2
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = bazel_tools_cpp_CROSSTOOL
template = ${:_profile_base_location_}/${:filename}.in
rendered = ${:location}/${:filename}
url = ${:_profile_base_location_}/${:filename}.in
output = ${:location}/${:filename}
context =
key gcc_location gcc:prefix
key binutils_location binutils:location
......@@ -28,8 +28,8 @@ context =
recipe = slapos.recipe.template:jinja2
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = bazel_src_main_cpp_BUILD
template = ${:_profile_base_location_}/${:filename}.in
rendered = ${:location}/${:filename}
url = ${:_profile_base_location_}/${:filename}.in
output = ${:location}/${:filename}
# We previously passed an argument that we don't want anymore. Rather than
# changing templates, we pass a dummy argument that will have no effect.
linkopts = -DSLAPOS_DUMMY=
......@@ -50,10 +50,10 @@ url = https://github.com/bazelbuild/bazel/releases/download/0.6.1/bazel-0.6.1-di
md5sum = 8c5c827e33d3ff74c263c1299810b485
patch-binary = ${patch:location}/bin/patch
patch-file-path = ${:_profile_base_location_}/bazel-0.6.1.patch
bazel-crosstool-modified-file-path = ${template-bazel-crosstool:rendered}
bazel-src-main-cpp-build-path = ${template-bazel-src-main-cpp-build:rendered}
bazel-src-main-tools-build-path = ${template-bazel-src-main-tools-build:rendered}
bazel-src-tools-singlejar-build-path = ${template-bazel-src-tools-singlejar-build:rendered}
bazel-crosstool-modified-file-path = ${template-bazel-crosstool:output}
bazel-src-main-cpp-build-path = ${template-bazel-src-main-cpp-build:output}
bazel-src-main-tools-build-path = ${template-bazel-src-main-tools-build:output}
bazel-src-tools-singlejar-build-path = ${template-bazel-src-tools-singlejar-build:output}
unzip-bin = ${unzip:location}/bin
zip-bin = ${zip:location}/bin
java_home = ${zulu:location}
......
......@@ -28,9 +28,9 @@ git-executable = ${git:location}/bin/git
[cythonplus_env.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:_buildout_section_name_}
template =
inline:{% set path, python = os.path.split(python) -%}
output = ${buildout:directory}/${:_buildout_section_name_}
inline =
{% set path, python = os.path.split(python) -%}
{% if 'part' in gcc -%}
{% set path = path + ':' + gcc.prefix + '/bin' -%}
{% endif -%}
......
......@@ -31,7 +31,7 @@ part = firefox
recipe = slapos.recipe.build
location = ${buildout:bin-directory}/${:part}
fonts-conf = ${firefox-default-fonts-conf:rendered}
fonts-conf = ${firefox-default-fonts-conf:output}
init =
self.buildout[options['part']]
install =
......@@ -72,8 +72,8 @@ part = firefox-52
[firefox-default-fonts-conf]
recipe = slapos.recipe.template:jinja2
template = ${template-fonts-conf:output}
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/fonts.conf
url = ${template-fonts-conf:output}
output = ${buildout:parts-directory}/${:_buildout_section_name_}/fonts.conf
context =
key cachedir :cache-dir
key fonts :fonts
......
......@@ -119,10 +119,10 @@ environment-extra =
#
# ${go:exe} is standalone executable that runs go in activated gowork environment.
[go]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template
exe = ${buildout:bin-directory}/go
rendered= ${:exe}
template= inline:
output= ${:exe}
inline =
#!/bin/sh -e
. ${gowork:env.sh}
exec go "$@"
......
......@@ -132,11 +132,11 @@ promises =
# as future-proof against new versions of Chromium.
[headless-chromium-wrapper]
recipe = slapos.recipe.template:jinja2
template =
inline:#!/bin/sh
inline =
#!/bin/sh
export LD_LIBRARY_PATH="{{ nss_location }}/lib:$LD_LIBRARY_PATH"
exec {{ chromium_binary }} "$@"
rendered = ${buildout:bin-directory}/headless-chromium
output = ${buildout:bin-directory}/headless-chromium
context =
key nss_location nss:location
key chromium_binary headless-chromium:binary
......@@ -34,10 +34,10 @@ install =
[helloweb-go]
# we already have gowork/bin/helloweb with helloweb Go build.
# Add bin/helloweb-go that runs go version of helloweb without any environment preset needed.
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
template =
inline:#!/bin/sh -e
recipe = slapos.recipe.template
output = ${buildout:bin-directory}/${:_buildout_section_name_}
inline =
#!/bin/sh -e
. ${gowork:env.sh}
exec helloweb "$@"
......@@ -97,9 +97,9 @@ make-targets= ${bundler:bundle} install
[helloweb-ruby]
# NOTE slapos.cookbook:wrapper also works, but currently _only_ in instance
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
template =
inline:#!/bin/sh -e
recipe = slapos.recipe.template
output = ${buildout:bin-directory}/${:_buildout_section_name_}
inline =
#!/bin/sh -e
export BUNDLE_GEMFILE=${helloweb-ruby-bundle:path}/Gemfile
exec ${bundler:bundle} exec sh -c 'helloweb.rb "$@"' ${:_buildout_section_name_} "$@"
......@@ -40,8 +40,8 @@ url = ${:_profile_base_location_}/${:filename}
[instance-jupyter-notebook]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/template.cfg
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
context =
key bin_directory buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
......
......@@ -15,7 +15,7 @@
[instance-jupyter-notebook]
filename = instance.cfg.in
md5sum = 357f28614a13cdbf00a29a83cbfd2642
md5sum = 9f412363ce2c2ac99e3328f7d87d456d
[jupyter-notebook-config]
filename = jupyter_notebook_config.py.jinja
......
......@@ -73,8 +73,8 @@ environment =
[jupyter-notebook-config]
recipe = slapos.recipe.template:jinja2
template = {{ jupyter_config_location }}/{{ jupyter_config_filename }}
rendered = ${directory:jupyter_config_dir}/jupyter_notebook_config.py
url = {{ jupyter_config_location }}/{{ jupyter_config_filename }}
output = ${directory:jupyter_config_dir}/jupyter_notebook_config.py
context =
raw config_cfg ${buildout:directory}/knowledge0.cfg
......@@ -130,8 +130,8 @@ target-directory = ${directory:erp5_kernel_dir}
[kernel-json]
recipe = slapos.recipe.template:jinja2
template = {{ kernel_json_location }}/{{ kernel_json_filename }}
rendered = ${directory:erp5_kernel_dir}/kernel.json
url = {{ kernel_json_location }}/{{ kernel_json_filename }}
output = ${directory:erp5_kernel_dir}/kernel.json
# Use python2.7 executable bin file for kernel config
context =
raw python_executable {{ python_executable }}
......
......@@ -12,8 +12,8 @@ parts =
[matplotlibrc]
recipe = slapos.recipe.template:jinja2
location = ${buildout:parts-directory}/${:_buildout_section_name_}
template = ${:_profile_base_location_}/${:filename}
rendered = ${matplotlibrc:location}/matplotlibrc
url = ${:_profile_base_location_}/${:filename}
output = ${matplotlibrc:location}/matplotlibrc
backend = agg
context =
key backend matplotlibrc:backend
......
......@@ -21,20 +21,20 @@ eggs +=
# env.sh for interpreter to be on $PATH.
[nxdtest-env.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = ${buildout:directory}/${:_buildout_section_name_}
inline =
export PS1="(nxdtest-env) $PS1"
export PATH=${buildout:bin-directory}:$PATH
# instance to run nxdtest.
[instance.cfg]
<= jinja2-template
template = inline:
inline =
[buildout]
extends = ${nxdtest-instance.cfg:rendered}
extends = ${nxdtest-instance.cfg:output}
[runTestSuite]
env.sh = ${nxdtest-env.sh:rendered}
env.sh = ${nxdtest-env.sh:output}
workdir = ${nxdtest-repository:location}
......@@ -73,7 +73,7 @@ perl-PATH = ${:location}/bin/
# dependencies
perl-bin = ${:perl-PATH}/perl
perl-PERL5LIB =
perl-PERL5LIB =
# Implementation
recipe = slapos.recipe.cmmi
......@@ -117,12 +117,12 @@ perl_location = ${perl:location}
# - inc : colon (:) separated site perl of modules to include in @INC
# Outputs:
# - perl-bin : an executable perl
recipe = slapos.recipe.template:jinja2
template = inline:
recipe = slapos.recipe.template
inline =
#!/bin/sh
{% set inc = "${:inc}".split(':') %} {# XXX we could remove duplicates from inc #}
exec ${perl:location}/bin/perl \
{% for item in inc -%}{% if item %} -I "{{ item }}" \
{% endif %}{% endfor %} "$@"
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
perl-bin = ${:rendered}
output = ${buildout:bin-directory}/${:_buildout_section_name_}
perl-bin = ${:output}
......@@ -88,12 +88,10 @@ init =
# .X.pyprog is python program to start and run entry
# it uses .X.pyexe as underlying python interpreter
[.%(name)s.pyprog]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template
exe = %(exe)s
rendered= $${:exe}
mode = 755
template=
inline:
output= $${:exe}
inline =
#!$${.%(name)s.pyexe:exe}
import sys
%(__pyinit)s
......
......@@ -28,21 +28,21 @@ eggs = ${pygolang:egg}
# env.sh for pygolang's python/gpython to be on $PATH.
[pygolang-env.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = ${buildout:directory}/${:_buildout_section_name_}
inline =
export PS1="(pygolang-env) $PS1"
export PATH=${buildout:bin-directory}:$PATH
# instance to run nxdtest.
[instance.cfg]
<= jinja2-template
template = inline:
inline =
[buildout]
extends = ${nxdtest-instance.cfg:rendered}
extends = ${nxdtest-instance.cfg:output}
[runTestSuite]
env.sh = ${pygolang-env.sh:rendered}
env.sh = ${pygolang-env.sh:output}
workdir = ${pygolang-repository:location}
......
......@@ -47,19 +47,17 @@ post-install =
keytar.node
[theia-wrapper]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
template =
inline:
recipe = slapos.recipe.template
output = ${buildout:bin-directory}/${:_buildout_section_name_}
inline =
#!/bin/sh
cd ${theia:location}
exec ${yarn:location}/bin/yarn theia start "$@"
[theia-open]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
template =
inline:
recipe = slapos.recipe.template
output = ${buildout:bin-directory}/${:_buildout_section_name_}
inline =
#!/bin/sh
exec ${nodejs:location}/bin/node ${theia:location}/node_modules/.bin/theia-open "$@"
......
......@@ -39,9 +39,9 @@ eggs =
# env.sh for that python + go to be on $PATH
[wendelin.core-env.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = ${buildout:directory}/${:_buildout_section_name_}
inline =
. ${gowork:env.sh}
export PS1="(wendelin.core-env) $PS1"
export PATH=${buildout:bin-directory}:${gdb:location}/bin:$PATH
......@@ -49,12 +49,12 @@ template = inline:
# instance to run nxdtest.
[instance.cfg]
<= jinja2-template
template = inline:
inline =
[buildout]
extends = ${nxdtest-instance.cfg:rendered}
extends = ${nxdtest-instance.cfg:output}
[runTestSuite]
env.sh = ${wendelin.core-env.sh:rendered}
env.sh = ${wendelin.core-env.sh:output}
workdir = ${wendelin.core-repository:location}
......
......@@ -23,21 +23,21 @@ eggs = ${zodbtools:egg}[test]
# env.sh for zodbtools's python to be on $PATH.
[zodbtools-env.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = ${buildout:directory}/${:_buildout_section_name_}
inline =
export PS1="(zodbtools-env) $PS1"
export PATH=${buildout:bin-directory}:$PATH
# instance to run nxdtest.
[instance.cfg]
<= jinja2-template
template = inline:
inline =
[buildout]
extends = ${nxdtest-instance.cfg:rendered}
extends = ${nxdtest-instance.cfg:output}
[runTestSuite]
env.sh = ${zodbtools-env.sh:rendered}
env.sh = ${zodbtools-env.sh:output}
workdir = ${zodbtools-repository:location}
......
......@@ -24,7 +24,7 @@ Here is an example of a section to add in your software.cfg :
openoffice-port = 1235
ooo-binary-path = ${directory:libreoffice-bin}/program
environment =
FONTCONFIG_FILE = $${fontconfig-conf:rendered}
FONTCONFIG_FILE = $${fontconfig-conf:output}
PATH = ${binary-link:target-directory}
ooo-uno-path = ${directory:libreoffice-bin}/basis-link/program
......
......@@ -46,8 +46,8 @@ md5sum = ae4a0043414336a521b524d9c95f1c68
[template-pullrdiffbackup]
filename = instance-pullrdiffbackup.cfg.in
md5sum = 45a4faa217ea5b83ecf271791e1632dd
md5sum = 931038cfa23216af1628b960a2e10de6
[template]
filename = instance.cfg.in
md5sum = 3df515def97f1e8a9f181514ae6ef03f
md5sum = 974e21f30669e1b83e1e0cd8def0adc3
......@@ -42,7 +42,6 @@ plugin = $${:etc}/plugin
recipe = slapos.recipe.template
url = ${template-dcron-service:output}
output = $${directory:services}/crond
mode = 0700
logfile = $${directory:log}/crond.log
#################################
......@@ -122,7 +121,6 @@ config-statistic_name = {{ '$${' ~ slave_reference }}-backup-script:statistic_na
recipe = slapos.recipe.template
url = ${template-backup-script:output}
output = $${directory:backupscript}/$${:_buildout_section_name_}
mode = 0700
datadirectory = {{ '$${' ~ slave_reference }}-backup-directory:directory}
sshkey = {{ '$${' ~ slave_reference }}-backup-private_key:key}
connection = {{ connection }}
......@@ -140,7 +138,6 @@ statistic_log = $${directory:statistic}/$${:statistic_name}
recipe = slapos.recipe.template
url = ${template-crontab-line:output}
output = $${directory:cron-lines}/$${:_buildout_section_name_}
mode = 0600
script = {{ '$${' ~ slave_reference }}-backup-script:output}
frequency = {{ frequency }}
{% do crontab_line_list.append("$${%s-backup-crontab-line:output}" % slave_reference) -%}
......@@ -155,14 +152,12 @@ frequency = {{ frequency }}
recipe = slapos.recipe.template
url = ${template-update-rss-script:output}
output = $${directory:etc}/$${:_buildout_section_name_}
mode = 0700
global_rss = $${slap-connection:computer-id}-$${slap-connection:partition-id}.rss
[update-rss-crontab-line]
recipe = slapos.recipe.template
url = ${template-crontab-line:output}
output = $${directory:cron-lines}/$${:_buildout_section_name_}
mode = 0600
script = $${update-rss-script:output}
frequency = */5 * * * *
{% do crontab_line_list.append("$${update-rss-crontab-line:output}") -%}
......@@ -186,8 +181,7 @@ command = ${coreutils-output:cat} ${template-crontab:output} {{ crontab_line_lis
recipe = slapos.recipe.template
url = ${template-nginx-service:output}
output = $${directory:services}/nginx
mode = 0700
virtual-depends =
virtual-depends =
$${nginx-configuration:ip}
[nginx-listen-promise]
......@@ -201,7 +195,6 @@ config-port = $${nginx-configuration:port}
recipe = slapos.recipe.template
url = ${template-nginx-configuration:output}
output = $${directory:etc}/nginx.cfg
mode = 0600
access_log = $${directory:log}/nginx-access.log
error_log = $${directory:log}/nginx-error.log
ip = {{ partition_ipv6 }}
......@@ -224,7 +217,7 @@ private-path-list +=
# Add parts generated by template
[buildout]
extends =
${monitor-template:rendered}
${monitor-template:output}
parts =
......
......@@ -8,8 +8,8 @@ offline = true
[dynamic-template-pullrdiffbackup]
recipe = slapos.recipe.template:jinja2
template = ${template-pullrdiffbackup:output}
rendered = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filename}
url = ${template-pullrdiffbackup:output}
output = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filename}
filename = instance-pullrdiffbackup.cfg
extensions = jinja2.ext.do
context =
......@@ -20,7 +20,7 @@ context =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = $${:pullrdiffbackup}
pullrdiffbackup = dynamic-template-pullrdiffbackup:rendered
pullrdiffbackup = dynamic-template-pullrdiffbackup:output
[slap-configuration]
# Fetches parameters defined in SlapOS Master for this instance.
......
......@@ -41,49 +41,41 @@ eggs =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
[template-nginx-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
[template-dcron-service]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
[template-backup-script]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
[template-crontab-line]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
[template-crontab]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
[status2rss]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
[template-update-rss-script]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
##########################################################
# Buildout instance.cfg templates
......@@ -92,13 +84,11 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template-pullrdiffbackup.cfg
mode = 0644
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 0644
[versions]
gunicorn = 19.1.1
......@@ -19,7 +19,7 @@ md5sum = c4079d70ab3268234651bf6c36234b2f
[template-instance-beremiz]
filename = instance-beremiz.cfg.jinja2.in
md5sum = ac05663b9006b7c4c9810a18e1ea4220
md5sum = 51071494633f4ffba700baf935dc6955
[template-instance-beremiz-test]
filename = instance-beremiz-test.cfg.jinja2.in
......
......@@ -95,7 +95,6 @@ inline =
{{ x11vnc_bin }} -storepasswd ${random-password:passwd} ${:passfile};
fi
output = ${directory:bin}/x11vnc_passwd
mode = 700
[generate-vnc-password]
recipe = plone.recipe.command
......
......@@ -116,14 +116,14 @@ context =
key buildout_directory buildout:directory
key template_fluxbox_menu template-fluxbox-menu.in:target
key template_fonts_conf_target template-fonts-conf:output
key template_monitor_cfg monitor2-template:rendered
key template_monitor_cfg monitor2-template:output
key template_instance_beremiz template-instance-beremiz:target
key template_instance_beremiz_test template-instance-beremiz-test:target
key template_logrotate template-logrotate-base:rendered
key template_logrotate template-logrotate-base:output
key fontconfig_location fontconfig:location
key font_dejavu dejavu-fonts:location
key font_liberation liberation-fonts:location
key logrotate_cfg template-logrotate-base:rendered
key logrotate_cfg template-logrotate-base:output
key bison_location bison:location
key flex_location flex:location
key fluxbox_location fluxbox:location
......@@ -134,7 +134,7 @@ context =
key matiec_location matiec:location
key mesa_location mesa:location
key novnc_location noVNC:location
key nxdtest_template nxdtest-instance.cfg:rendered
key nxdtest_template nxdtest-instance.cfg:output
key python_bin :python-bin
key opencv_location opencv:location
key openssl_location openssl:location
......
......@@ -50,12 +50,12 @@ eggs = click
[instance-profile]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
raw template_monitor ${monitor2-template:rendered}
raw template_monitor ${monitor2-template:output}
# md5sum is fetched from buildout.hash.cfg and can be recalculated automatically by
# calling update-hash
......
......@@ -11,8 +11,8 @@ download-cache = ${:directory}/download-cache
[template]
recipe = slapos.recipe.template:jinja2
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
template = inline:
output = ${buildout:directory}/template.cfg
inline =
[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
......@@ -29,9 +29,8 @@ template = inline:
bin = $${buildout:directory}/bin
[runTestSuite]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
template = ${:_profile_base_location_}/$${:_buildout_section_name_}.in
mode = 0755
output = $${directory:bin}/$${:_buildout_section_name_}
url = ${:_profile_base_location_}/$${:_buildout_section_name_}.in
context =
{##} section buildout buildout
{##} section parameter_dict runTestSuite-parameters
......
......@@ -20,11 +20,10 @@ scripts = ${:interpreter}
interpreter = ${:_buildout_section_name_}
[template]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
template =
inline:
output = ${buildout:directory}/template.cfg
inline =
[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
......@@ -51,9 +50,8 @@ template =
[runTestSuite]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
template = ${:_profile_base_location_}/$${:_buildout_section_name_}.in
mode = 0755
output = $${directory:bin}/$${:_buildout_section_name_}
url = ${:_profile_base_location_}/$${:_buildout_section_name_}.in
context =
key slapparameter_dict slap-configuration:configuration
key slapos_buildout slapos.buildout-repository:location
......
......@@ -14,7 +14,7 @@
# not need these here).
[template]
filename = instance.cfg.in
md5sum = fb3a20e7f555a9ce7fe1ec547d0fcdfc
md5sum = 051ae51b86f9aba169a6777fa2239901
[profile-common]
filename = instance-common.cfg.in
......@@ -22,15 +22,15 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-caddy-frontend]
filename = instance-apache-frontend.cfg.in
md5sum = 04e550480d3057ca65d87c6fadbaed6e
md5sum = 02ce5d44d49982fda598e3086cfbca99
[profile-caddy-replicate]
filename = instance-apache-replicate.cfg.in
md5sum = 63b418626ef0f8ac54d6359fb6637371
md5sum = bc2a8550c9b603bdfacd3a30a0189218
[profile-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
md5sum = e3ba0da5d137dcbd56c2604d200ac3b9
md5sum = 964a7f673f441f3a3e90c88ab03e3351
[profile-replicate-publish-slave-information]
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
......@@ -102,7 +102,7 @@ md5sum = b41b8de115ad815d0b0db306ad650365
[profile-kedifa]
filename = instance-kedifa.cfg.in
md5sum = 88f3a8cc30d3cf30f4bd2797f5c16221
md5sum = b5426129668f39ace55f14012c4a2fd2
[template-backend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in
......
......@@ -168,10 +168,10 @@ slave-introspection-var = ${:var}/slave-introspection
[switch-caddy-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-custom-personal-profile-slave-list:rendered
default = dynamic-custom-personal-profile-slave-list:output
RootSoftwareInstance = ${:default}
single-default = dynamic-custom-personal-profile-slave-list:rendered
single-custom-personal = dynamic-custom-personal-profile-slave-list:rendered
single-default = dynamic-custom-personal-profile-slave-list:output
single-custom-personal = dynamic-custom-personal-profile-slave-list:output
[frontend-configuration]
ip-access-certificate = ${self-signed-ip-access:certificate}
......@@ -228,7 +228,7 @@ command =
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
output = ${buildout:directory}/${:filename}
extensions = jinja2.ext.do
extra-context =
slapparameter_dict = {{ dumps(slapparameter_dict) }}
......@@ -348,7 +348,7 @@ stop-on-error = True
[dynamic-custom-personal-profile-slave-list]
< = jinja2-template-base
depends = ${caddyprofiledeps:recipe}
template = {{ software_parameter_dict['profile_slave_list'] }}
url = {{ software_parameter_dict['profile_slave_list'] }}
filename = custom-personal-instance-slave-list.cfg
master_key_download_url = {{ dumps(slapparameter_dict['master-key-download-url']) }}
software_type = single-custom-personal
......@@ -372,15 +372,15 @@ extra-context =
key template_default_slave_configuration software-release-path:template-default-slave-virtualhost
key template_expose_csr_nginx_conf software-release-path:template-expose-csr-nginx-conf
key software_type :software_type
key frontend_lazy_graceful_reload frontend-caddy-lazy-graceful:rendered
key monitor_base_url monitor-instance-parameter:monitor-base-url
key frontend_lazy_graceful_reload frontend-caddy-lazy-graceful:output
key monitor_base_url monitor-instance-parameter:monitor-base-url
key node_id frontend-node-id:value
key version_hash version-hash:value
key software_release_url version-hash:software-release-url
key node_information frontend-node-information:value
key custom_ssl_directory caddy-directory:custom-ssl-directory
# BBB: SlapOS Master non-zero knowledge BEGIN
key apache_certificate apache-certificate:rendered
key apache_certificate apache-certificate:output
# BBB: SlapOS Master non-zero knowledge END
## backend haproxy
key template_backend_haproxy_configuration software-release-path:template-backend-haproxy-configuration
......@@ -396,8 +396,8 @@ extra-context =
# Deploy Caddy Frontend with Jinja power
[dynamic-caddy-frontend-template]
< = jinja2-template-base
template = {{ software_parameter_dict['template_caddy_frontend_configuration'] }}
rendered = ${caddy-configuration:frontend-configuration}
url = {{ software_parameter_dict['template_caddy_frontend_configuration'] }}
output = ${caddy-configuration:frontend-configuration}
local_ipv4 = {{ dumps(instance_parameter_dict['ipv4-random']) }}
extra-context =
key instance_home buildout:directory
......@@ -414,37 +414,32 @@ extra-context =
key username monitor-instance-parameter:username
key password monitor-htpasswd:passwd
# BBB: SlapOS Master non-zero knowledge BEGIN
key apache_certificate apache-certificate:rendered
key apache_certificate apache-certificate:output
# BBB: SlapOS Master non-zero knowledge END
[caddy-wrapper]
recipe = slapos.recipe.template:jinja2
template = inline:
inline =
#!/bin/sh
export CADDYPATH=${directory:frontend_cluster}
ulimit -n $(ulimit -Hn)
exec {{ software_parameter_dict['caddy'] }} \
-conf ${dynamic-caddy-frontend-template:rendered} \
-conf ${dynamic-caddy-frontend-template:output} \
-log ${caddy-configuration:error-log} \
-log-roll-mb 0 \
{% if instance_parameter_dict['configuration.global-disable-http2'].lower() in TRUE_VALUES %}
-http2=false \
{% else %}
-http2=true \
{% endif %}
{% if instance_parameter_dict['configuration.global-disable-http2'].lower() in TRUE_VALUES %}-http2=false \{% else %}-http2=true \{% endif %}
-grace {{ instance_parameter_dict['configuration.mpm-graceful-shutdown-timeout'] }}s \
-disable-http-challenge \
-disable-tls-alpn-challenge \
"$@"
rendered = ${directory:bin}/caddy-wrapper
mode = 0755
output = ${directory:bin}/caddy-wrapper
[caddy-frontend]
recipe = slapos.cookbook:wrapper
command-line = ${caddy-wrapper:rendered} -pidfile ${caddy-configuration:pid-file}
command-line = ${caddy-wrapper:output} -pidfile ${caddy-configuration:pid-file}
wrapper-path = ${directory:service}/frontend_caddy
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
hash-files = ${caddy-wrapper:rendered}
hash-files = ${caddy-wrapper:output}
[not-found-html]
recipe = plone.recipe.command
......@@ -466,7 +461,7 @@ frontend-configuration = ${directory:etc}/Caddyfile
access-log = ${directory:log}/frontend-access.log
error-log = ${directory:log}/frontend-error.log
pid-file = ${directory:run}/httpd.pid
frontend-graceful-command = ${frontend-caddy-validate:rendered} && kill -USR1 $(cat ${:pid-file})
frontend-graceful-command = ${frontend-caddy-validate:output} && kill -USR1 $(cat ${:pid-file})
not-found-file = ${caddy-directory:document-root}/${not-found-html:filename}
master-certificate = ${caddy-directory:master-autocert-dir}/master.pem
# Communication with ATS
......@@ -475,7 +470,7 @@ cache-port = ${trafficserver-variable:input-port}
slave-introspection-access-log = ${directory:log}/slave-introspection-access.log
slave-introspection-error-log = ${directory:log}/slave-introspection-error.log
slave-introspection-pid-file = ${directory:run}/slave-introspection.pid
slave-introspection-graceful-command = ${slave-introspection-validate:rendered} && kill -HUP $(cat ${:slave-introspection-pid-file})
slave-introspection-graceful-command = ${slave-introspection-validate:output} && kill -HUP $(cat ${:slave-introspection-pid-file})
# BBB: SlapOS Master non-zero knowledge BEGIN
[get-self-signed-fallback-access]
......@@ -485,7 +480,7 @@ commands =
[apache-certificate]
recipe = slapos.recipe.template:jinja2
template = inline:
inline =
{% raw %}
{{ certificate or fallback_certificate }}
{{ key or '' }}
......@@ -494,7 +489,7 @@ context =
key certificate configuration:apache-certificate
key key configuration:apache-key
key fallback_certificate get-self-signed-fallback-access:certificate
rendered = ${directory:bbb-ssl-dir}/frontend.crt
output = ${directory:bbb-ssl-dir}/frontend.crt
# BBB: SlapOS Master non-zero knowledge END
[logrotate-entry-caddy]
......@@ -507,7 +502,7 @@ rotate-num = ${configuration:rotate-num}
# olddir
# Here we trust that there will be something to be rotated with error
# or access log, and that this will trigger postrotate script.
post = ${frontend-caddy-lazy-graceful:rendered} &
post = ${frontend-caddy-lazy-graceful:output} &
delaycompress =
#################
......@@ -561,9 +556,8 @@ environment = TS_ROOT=${buildout:directory}
# XXX Dedicated Jinja Section without slapparameter
[trafficserver-jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${trafficserver-directory:configuration}/${:filename}
output = ${trafficserver-directory:configuration}/${:filename}
extra-context =
mode = 600
context =
section ats_directory trafficserver-directory
section ats_configuration trafficserver-variable
......@@ -571,25 +565,25 @@ context =
[trafficserver-records-config]
< = trafficserver-jinja2-template-base
template = {{ software_parameter_dict['template_trafficserver_records_config'] }}
url = {{ software_parameter_dict['template_trafficserver_records_config'] }}
filename = records.config
extra-context =
import os_module os
[trafficserver-storage-config]
< = trafficserver-jinja2-template-base
template = {{ software_parameter_dict['template_trafficserver_storage_config'] }}
url = {{ software_parameter_dict['template_trafficserver_storage_config'] }}
filename = storage.config
[trafficserver-logging-yaml]
< = trafficserver-jinja2-template-base
template = {{ software_parameter_dict['template_trafficserver_logging_yaml'] }}
url = {{ software_parameter_dict['template_trafficserver_logging_yaml'] }}
filename = logging.yaml
[trafficserver-remap-config]
<= trafficserver-jinja2-template-base
{%- raw %}
template = inline:
inline =
map /HTTPS/ http://{{ ipv4 }}:{{ https_port }}
map /HTTP/ http://{{ ipv4 }}:{{ http_port }}
{%- endraw %}
......@@ -602,14 +596,14 @@ filename = remap.config
[trafficserver-plugin-config]
< = trafficserver-jinja2-template-base
template = {{ software_parameter_dict['template_empty'] }}
url = {{ software_parameter_dict['template_empty'] }}
filename = plugin.config
context =
key content trafficserver-variable:plugin-config
[trafficserver-ip-allow-config]
< = trafficserver-jinja2-template-base
template = {{ software_parameter_dict['template_empty'] }}
url = {{ software_parameter_dict['template_empty'] }}
filename = ip_allow.config
context =
key content trafficserver-variable:ip-allow-config
......@@ -635,9 +629,8 @@ config-wrapper-path = ${trafficserver-ctl:wrapper-path}
[trafficserver-rotate-script]
< = jinja2-template-base
template = {{ software_parameter_dict['template_rotate_script'] }}
rendered = ${directory:bin}/trafficserver-rotate
mode = 0700
url = {{ software_parameter_dict['template_rotate_script'] }}
output = ${directory:bin}/trafficserver-rotate
xz_binary = {{ software_parameter_dict['xz_location'] ~ '/bin/xz' }}
pattern = *.old
# days to keep log files
......@@ -655,16 +648,15 @@ recipe = slapos.cookbook:cron.d
cron-entries = ${directory:etc}/cron.d
name = trafficserver-logrotate
frequency = 0 0 * * *
command = ${trafficserver-rotate-script:rendered}
command = ${trafficserver-rotate-script:output}
### End of ATS sections
### Caddy Graceful and promises
[frontend-caddy-configuration-state]
< = jinja2-template-base
template = {{ software_parameter_dict['template_configuration_state_script'] }}
rendered = ${directory:bin}/${:_buildout_section_name_}
mode = 0700
url = {{ software_parameter_dict['template_configuration_state_script'] }}
output = ${directory:bin}/${:_buildout_section_name_}
path_list = ${caddy-configuration:frontend-configuration} ${caddy-directory:slave-configuration}/*.conf ${caddy-directory:master-autocert-dir}/*.key ${caddy-directory:master-autocert-dir}/*.crt ${caddy-directory:master-autocert-dir}/*.pem ${caddy-directory:autocert}/*.pem ${caddy-directory:custom-ssl-directory}/*.proxy_ca_crt ${directory:bbb-ssl-dir}/*.crt
sha256sum = {{ software_parameter_dict['sha256sum'] }}
......@@ -684,31 +676,28 @@ signature_file = ${directory:run}/validate_configuration_state_signature
[frontend-caddy-graceful]
< = jinja2-template-base
template = {{ software_parameter_dict['template_graceful_script'] }}
rendered = ${directory:etc-run}/frontend-caddy-safe-graceful
mode = 0700
url = {{ software_parameter_dict['template_graceful_script'] }}
output = ${directory:etc-run}/frontend-caddy-safe-graceful
extra-context =
key graceful_reload_command caddy-configuration:frontend-graceful-command
key caddy_configuration_state frontend-caddy-configuration-state-graceful:rendered
key caddy_configuration_state frontend-caddy-configuration-state-graceful:output
[frontend-caddy-validate]
< = jinja2-template-base
template = {{ software_parameter_dict['template_validate_script'] }}
rendered = ${directory:bin}/frontend-caddy-validate
mode = 0700
url = {{ software_parameter_dict['template_validate_script'] }}
output = ${directory:bin}/frontend-caddy-validate
last_state_file = ${directory:run}/caddy_configuration_last_state
validate_command = ${caddy-wrapper:rendered} -validate
validate_command = ${caddy-wrapper:output} -validate
extra-context =
key validate_command :validate_command
key configuration_state_command frontend-caddy-configuration-state-validate:rendered
key configuration_state_command frontend-caddy-configuration-state-validate:output
key last_state_file :last_state_file
[frontend-caddy-lazy-graceful]
< = jinja2-template-base
template = {{ software_parameter_dict['template_caddy_lazy_script_call'] }}
rendered = ${directory:bin}/frontend-caddy-lazy-graceful
mode = 0700
url = {{ software_parameter_dict['template_caddy_lazy_script_call'] }}
output = ${directory:bin}/frontend-caddy-lazy-graceful
pid-file = ${directory:run}/lazy-graceful.pid
wait_time = 60
extra-context =
......@@ -719,9 +708,8 @@ extra-context =
# Promises checking configuration:
[promise-helper-last-configuration-state]
< = jinja2-template-base
template = {{ software_parameter_dict['template_empty'] }}
rendered = ${directory:bin}/frontend-read-last-configuration-state
mode = 0700
url = {{ software_parameter_dict['template_empty'] }}
output = ${directory:bin}/frontend-read-last-configuration-state
content =
#!/bin/sh
exit `cat ${frontend-caddy-validate:last_state_file}`
......@@ -732,7 +720,7 @@ context =
<= monitor-promise-base
promise = validate_frontend_configuration
name = frontend-caddy-configuration-promise.py
config-verification-script = ${promise-helper-last-configuration-state:rendered}
config-verification-script = ${promise-helper-last-configuration-state:output}
[promise-caddy-frontend-v4-https]
<= monitor-promise-base
......@@ -780,7 +768,7 @@ config-port = ${backend-haproxy-configuration:https-port}
file = ${directory:etc}/backend-haproxy.cfg
pid-file = ${directory:run}/backend-haproxy.pid
log-socket = ${backend-haproxy-rsyslogd-config:log-socket}
graceful-command = ${backend-haproxy-validate:rendered} && kill -USR2 $(cat ${:pid-file})
graceful-command = ${backend-haproxy-validate:output} && kill -USR2 $(cat ${:pid-file})
http-port = ${configuration:backend-haproxy-http-port}
https-port = ${configuration:backend-haproxy-https-port}
# Caucase related configuration
......@@ -806,9 +794,8 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
[backend-haproxy-rsyslogd-lazy-graceful]
< = jinja2-template-base
template = {{ software_parameter_dict['template_caddy_lazy_script_call'] }}
rendered = ${directory:bin}/backend-haproxy-rsyslogd-lazy-graceful
mode = 0700
url = {{ software_parameter_dict['template_caddy_lazy_script_call'] }}
output = ${directory:bin}/backend-haproxy-rsyslogd-lazy-graceful
pid-file = ${directory:run}/backend-haproxy-rsyslogd-lazy-graceful.pid
wait_time = 60
extra-context =
......@@ -826,14 +813,13 @@ rotate-num = ${configuration:rotate-num}
# olddir
# Here we trust that there will be something to be rotated with error
# or access log, and that this will trigger postrotate script.
post = ${backend-haproxy-rsyslogd-lazy-graceful:rendered} &
post = ${backend-haproxy-rsyslogd-lazy-graceful:output} &
delaycompress =
[backend-haproxy-configuration-state]
<= jinja2-template-base
template = {{ software_parameter_dict['template_configuration_state_script'] }}
rendered = ${directory:bin}/${:_buildout_section_name_}
mode = 0700
url = {{ software_parameter_dict['template_configuration_state_script'] }}
output = ${directory:bin}/${:_buildout_section_name_}
path_list = ${backend-haproxy-configuration:file} ${backend-client-login-config:certificate}
sha256sum = {{ software_parameter_dict['sha256sum'] }}
......@@ -853,37 +839,34 @@ signature_file = ${directory:run}/backend_haproxy_validate_configuration_state_s
[backend-haproxy-graceful]
< = jinja2-template-base
template = {{ software_parameter_dict['template_graceful_script'] }}
rendered = ${directory:etc-run}/backend-haproxy-safe-graceful
mode = 0700
url = {{ software_parameter_dict['template_graceful_script'] }}
output = ${directory:etc-run}/backend-haproxy-safe-graceful
extra-context =
key graceful_reload_command backend-haproxy-configuration:graceful-command
key caddy_configuration_state backend-haproxy-configuration-state-graceful:rendered
key caddy_configuration_state backend-haproxy-configuration-state-graceful:output
[backend-haproxy-validate]
<= jinja2-template-base
template = {{ software_parameter_dict['template_validate_script'] }}
rendered = ${directory:bin}/backend-haproxy-validate
mode = 0700
url = {{ software_parameter_dict['template_validate_script'] }}
output = ${directory:bin}/backend-haproxy-validate
last_state_file = ${directory:run}/backend_haproxy_configuration_last_state
validate_command = {{ software_parameter_dict['haproxy_executable'] }} -f ${backend-haproxy-configuration:file} -c
extra-context =
key validate_command :validate_command
key configuration_state_command backend-haproxy-configuration-state-validate:rendered
key configuration_state_command backend-haproxy-configuration-state-validate:output
key last_state_file :last_state_file
[promise-backend-haproxy-configuration]
<= monitor-promise-base
promise = validate_frontend_configuration
name = backend-haproxy-configuration.py
config-verification-script = ${promise-backend-haproxy-configuration-helper:rendered}
config-verification-script = ${promise-backend-haproxy-configuration-helper:output}
[promise-backend-haproxy-configuration-helper]
< = jinja2-template-base
template = {{ software_parameter_dict['template_empty'] }}
rendered = ${directory:bin}/backend-haproxy-read-last-configuration-state
mode = 0700
url = {{ software_parameter_dict['template_empty'] }}
output = ${directory:bin}/backend-haproxy-read-last-configuration-state
content =
#!/bin/sh
exit `cat ${backend-haproxy-validate:last_state_file}`
......@@ -900,14 +883,14 @@ caddy-log-directory = ${caddy-directory:slave-log}
[backend-haproxy-rsyslogd-configuration]
<= jinja2-template-base
template = ${software-release-path:template-backend-haproxy-rsyslogd-conf}
rendered = ${directory:etc}/backend-haproxy-rsyslogd.conf
url = ${software-release-path:template-backend-haproxy-rsyslogd-conf}
output = ${directory:etc}/backend-haproxy-rsyslogd.conf
extra-context =
section configuration backend-haproxy-rsyslogd-config
[backend-haproxy-rsyslogd]
recipe = slapos.cookbook:wrapper
command-line = {{ software_parameter_dict['rsyslogd_executable'] }} -i ${backend-haproxy-rsyslogd-config:pid-file} -n -f ${backend-haproxy-rsyslogd-configuration:rendered}
command-line = {{ software_parameter_dict['rsyslogd_executable'] }} -i ${backend-haproxy-rsyslogd-config:pid-file} -n -f ${backend-haproxy-rsyslogd-configuration:output}
wrapper-path = ${directory:service}/backend-haproxy-rsyslogd
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
......@@ -923,15 +906,14 @@ monitor-httpd-port = {{ instance_parameter_dict['configuration.monitor-httpd-por
password = {{ instance_parameter_dict['configuration.monitor-password'] | string }}
[monitor-conf-parameters]
private-path-list +=
private-path-list +=
${logrotate-directory:logrotate-backup}
[monitor-traffic-summary-last-stats-wrapper]
< = jinja2-template-base
template = {{ software_parameter_dict['template_wrapper'] }}
rendered = ${directory:bin}/traffic-summary-last-stats_every_1_hour
mode = 0700
url = {{ software_parameter_dict['template_wrapper'] }}
output = ${directory:bin}/traffic-summary-last-stats_every_1_hour
command = export TS_ROOT=${buildout:directory} && echo "<pre>$({{ software_parameter_dict['trafficserver'] }}/bin/traffic_logstats -f ${trafficserver-directory:log}/squid.blog)</pre>"
extra-context =
key content monitor-traffic-summary-last-stats-wrapper:command
......@@ -939,27 +921,24 @@ extra-context =
# Produce ATS Cache stats
[monitor-ats-cache-stats-wrapper]
< = jinja2-template-base
template = {{ software_parameter_dict['template_wrapper'] }}
rendered = ${directory:bin}/ats-cache-stats_every_1_hour
mode = 0700
command = export TS_ROOT=${buildout:directory} && echo "<pre>$({{ software_parameter_dict['trafficserver'] }}/bin/traffic_shell ${monitor-ats-cache-stats-config:rendered})</pre>"
url = {{ software_parameter_dict['template_wrapper'] }}
output = ${directory:bin}/ats-cache-stats_every_1_hour
command = export TS_ROOT=${buildout:directory} && echo "<pre>$({{ software_parameter_dict['trafficserver'] }}/bin/traffic_shell ${monitor-ats-cache-stats-config:output})</pre>"
extra-context =
key content monitor-ats-cache-stats-wrapper:command
[monitor-caddy-server-status-wrapper]
< = jinja2-template-base
template = {{ software_parameter_dict['template_wrapper'] }}
rendered = ${directory:bin}/monitor-caddy-server-status-wrapper
mode = 0700
url = {{ software_parameter_dict['template_wrapper'] }}
output = ${directory:bin}/monitor-caddy-server-status-wrapper
command = {{ software_parameter_dict['curl'] }}/bin/curl -s http://{{ instance_parameter_dict['ipv4-random'] }}:${configuration:plain_http_port}/server-status -u ${monitor-instance-parameter:username}:${monitor-htpasswd:passwd} 2>&1
extra-context =
key content monitor-caddy-server-status-wrapper:command
[monitor-ats-cache-stats-config]
< = jinja2-template-base
template = {{ software_parameter_dict['template_empty'] }}
rendered = ${trafficserver-configuration-directory:target}/cache-config.stats
mode = 644
url = {{ software_parameter_dict['template_empty'] }}
output = ${trafficserver-configuration-directory:target}/cache-config.stats
context =
raw content show:cache-stats
......@@ -971,10 +950,9 @@ config-url = ${configuration:re6st-verification-url}
[port-redirection]
<= jinja2-template-base
template = inline:
inline =
[{"srcPort": 80, "destPort": {{ '{{' }} http_port {{ '}}' }}}, {"srcPort": 443, "destPort": {{ '{{' }} https_port {{ '}}' }}}]
rendered = ${buildout:directory}/.slapos-port-redirect
mode = 0644
output = ${buildout:directory}/.slapos-port-redirect
extra-context =
key http_port configuration:plain_http_port
key https_port configuration:port
......@@ -1009,9 +987,8 @@ config-url =
[slave-introspection-configuration-state]
<= jinja2-template-base
template = {{ software_parameter_dict['template_configuration_state_script'] }}
rendered = ${directory:bin}/${:_buildout_section_name_}
mode = 0700
url = {{ software_parameter_dict['template_configuration_state_script'] }}
output = ${directory:bin}/${:_buildout_section_name_}
path_list = ${frontend-configuration:slave-introspection-configuration} ${frontend-configuration:ip-access-certificate}
sha256sum = {{ software_parameter_dict['sha256sum'] }}
......@@ -1031,37 +1008,34 @@ signature_file = ${directory:run}/slave_introspection_validate_configuration_sta
[slave-introspection-graceful]
< = jinja2-template-base
template = {{ software_parameter_dict['template_graceful_script'] }}
rendered = ${directory:etc-run}/slave-introspection-safe-graceful
mode = 0700
url = {{ software_parameter_dict['template_graceful_script'] }}
output = ${directory:etc-run}/slave-introspection-safe-graceful
extra-context =
key graceful_reload_command caddy-configuration:slave-introspection-graceful-command
key caddy_configuration_state slave-introspection-configuration-state-graceful:rendered
key caddy_configuration_state slave-introspection-configuration-state-graceful:output
[slave-introspection-validate]
<= jinja2-template-base
template = {{ software_parameter_dict['template_validate_script'] }}
rendered = ${directory:bin}/slave-introspection-validate
mode = 0700
url = {{ software_parameter_dict['template_validate_script'] }}
output = ${directory:bin}/slave-introspection-validate
last_state_file = ${directory:run}/slave_introspection_configuration_last_state
validate_command = {{ software_parameter_dict['nginx'] }} -c ${frontend-configuration:slave-introspection-configuration} -t
extra-context =
key validate_command :validate_command
key configuration_state_command slave-introspection-configuration-state-validate:rendered
key configuration_state_command slave-introspection-configuration-state-validate:output
key last_state_file :last_state_file
[promise-slave-introspection-configuration]
<= monitor-promise-base
promise = validate_frontend_configuration
name = slave-introspection-configuration.py
config-verification-script = ${promise-slave-introspection-configuration-helper:rendered}
config-verification-script = ${promise-slave-introspection-configuration-helper:output}
[promise-slave-introspection-configuration-helper]
< = jinja2-template-base
template = {{ software_parameter_dict['template_empty'] }}
rendered = ${directory:bin}/slave-introspection-read-last-configuration-state
mode = 0700
url = {{ software_parameter_dict['template_empty'] }}
output = ${directory:bin}/slave-introspection-read-last-configuration-state
content =
#!/bin/sh
exit `cat ${slave-introspection-validate:last_state_file}`
......
......@@ -33,7 +33,7 @@
{% set caucase_url = 'http://' ~ caucase_netloc %}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
output = ${buildout:directory}/${:filename}
extra-context =
context =
import json_module json
......@@ -403,11 +403,11 @@ config-url =
#-- Publish slave information
[publish-slave-information]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-publish-slave-information:rendered
default = dynamic-publish-slave-information:output
RootSoftwareInstance = ${:default}
replicate = dynamic-publish-slave-information:rendered
custom-personal = dynamic-publish-slave-information:rendered
custom-group = dynamic-publish-slave-information:rendered
replicate = dynamic-publish-slave-information:output
custom-personal = dynamic-publish-slave-information:output
custom-group = dynamic-publish-slave-information:output
[request-kedifa]
<= slap-connection
......@@ -470,7 +470,7 @@ active-slave-instance-list = {{ json_module.dumps(active_slave_instance_list, so
[dynamic-publish-slave-information]
< = jinja2-template-base
template = {{ software_parameter_dict['profile_replicate_publish_slave_information'] }}
url = {{ software_parameter_dict['profile_replicate_publish_slave_information'] }}
filename = dynamic-publish-slave-information.cfg
extensions = jinja2.ext.do
extra-context =
......@@ -538,20 +538,17 @@ stop-on-error = True
recipe = slapos.recipe.template:jinja2
context =
key caucase_url aikc-config:caucase-url
template = inline:#!{{ software_parameter_dict['dash'] }}/bin/dash
inline =
#!{{ software_parameter_dict['dash'] }}/bin/dash
exec {{ software_parameter_dict['bin_directory'] }}/caucase \
{# raw block to use context #}
{% raw %}
--ca-url {{ caucase_url }} \
{% endraw %}
--ca-url {{ '{{ caucase_url }}' }} \
--ca-crt ${aikc-config:ca-certificate} \
--user-ca-crt ${aikc-config:user-ca-certificate} \
--user-crl ${aikc-config:user-crl} \
--crl ${aikc-config:crl} \
"$@"
rendered = ${directory:bin}/aikc-caucase-wrapper
mode = 0700
output = ${directory:bin}/aikc-caucase-wrapper
{% do part_list.append('aikc-create-user') %}
[aikc-create-user]
......@@ -562,11 +559,11 @@ update-command = ${:command}
csr_id = ${directory:aikc}/csr_id
command =
if ! [ -f ${aikc-config:user-created} ] ; then
${aikc-caucase-wrapper:rendered} --mode user --send-csr ${aikc-user-csr:csr} > ${:csr_id} || exit 1
${aikc-caucase-wrapper:output} --mode user --send-csr ${aikc-user-csr:csr} > ${:csr_id} || exit 1
cut -d ' ' -f 1 ${:csr_id} || exit 1
csr_id=`cut -d ' ' -f 1 ${:csr_id}`
sleep 1
${aikc-caucase-wrapper:rendered} --mode user --get-crt $csr_id ${aikc-config:key} || exit 1
${aikc-caucase-wrapper:output} --mode user --get-crt $csr_id ${aikc-config:key} || exit 1
touch ${aikc-config:user-created}
fi
......@@ -662,21 +659,18 @@ stop-on-error = True
recipe = slapos.recipe.template:jinja2
context =
key caucase_url aibcc-config:caucase-url
template = inline:#!{{ software_parameter_dict['dash'] }}/bin/dash
inline =
#!{{ software_parameter_dict['dash'] }}/bin/dash
exec {{ software_parameter_dict['bin_directory'] }}/caucase \
{# raw block to use context #}
{% raw %}
--ca-url {{ caucase_url }} \
{% endraw %}
--ca-url {{ '{{ caucase_url }}' }} \
--ca-crt ${aibcc-config:ca-certificate} \
--user-ca-crt ${aibcc-config:user-ca-certificate} \
--user-crl ${aibcc-config:user-crl} \
--crl ${aibcc-config:crl} \
"$@"
rendered = ${directory:bin}/aibcc-caucase-wrapper
mode = 0700
output = ${directory:bin}/aibcc-caucase-wrapper
{% do part_list.append('aibcc-create-user') %}
[aibcc-create-user]
......@@ -689,11 +683,11 @@ update-command = ${:command}
csr_id = ${directory:aibcc}/csr_id
command =
if ! [ -f ${aibcc-config:user-created} ] ; then
${aibcc-caucase-wrapper:rendered} --mode user --send-csr ${aibcc-user-csr:csr} > ${:csr_id} || exit 1
${aibcc-caucase-wrapper:output} --mode user --send-csr ${aibcc-user-csr:csr} > ${:csr_id} || exit 1
cut -d ' ' -f 1 ${:csr_id} || exit 1
csr_id=`cut -d ' ' -f 1 ${:csr_id}`
sleep 1
${aibcc-caucase-wrapper:rendered} --mode user --get-crt $csr_id ${aibcc-config:key} || exit 1
${aibcc-caucase-wrapper:output} --mode user --get-crt $csr_id ${aibcc-config:key} || exit 1
touch ${aibcc-config:user-created}
fi
......@@ -754,8 +748,8 @@ update-command = ${:command}
recipe = slapos.recipe.template:jinja2
filename = rejected-slave.json
directory = ${directory:promise-output}
rendered = ${:directory}/${:filename}
template = {{ software_parameter_dict['template_empty'] }}
output = ${:directory}/${:filename}
url = {{ software_parameter_dict['template_empty'] }}
{% if critical_rejected_slave_dict %}
{# sort_keys are important in order to avoid shuffling parameters on each run #}
content = {{ dumps(json_module.dumps(critical_rejected_slave_dict, indent=2, sort_keys=True)) }}
......@@ -778,13 +772,13 @@ directory = ${rejected-slave-json:directory}
url = https://${rejected-slave-password:user}:${rejected-slave-password:passwd}@[${rejected-slave-publish-configuration:ip}]:${rejected-slave-publish-configuration:port}/${rejected-slave-json:filename}
recipe = slapos.cookbook:wrapper
command-line = {{ software_parameter_dict['nginx'] }}
-c ${rejected-slave-template:rendered}
-c ${rejected-slave-template:output}
wrapper-path = ${directory:service}/rejected-slave-publish
hash-existing-files =
${buildout:directory}/software_release/buildout.cfg
hash-files =
${rejected-slave-template:rendered}
${rejected-slave-template:output}
${rejected-slave-certificate:certificate}
[rejected-slave-certificate]
......@@ -822,7 +816,7 @@ command = {{ software_parameter_dict['htpasswd'] }} -cb ${:file} ${rejected-slav
recipe = slapos.recipe.template:jinja2
var = ${directory:rejected-var}
pid = ${directory:var}/nginx-rejected.pid
template = inline:
inline =
daemon off;
pid ${:pid};
error_log stderr;
......@@ -856,7 +850,7 @@ template = inline:
}
}
rendered = ${directory:etc}/nginx-rejected-slave.conf
output = ${directory:etc}/nginx-rejected-slave.conf
[promise-rejected-slave-publish-ip-port]
<= monitor-promise-base
......@@ -870,7 +864,7 @@ config-port = ${rejected-slave-publish-configuration:port}
promise = check_socket_listening
promise = check_file_state
name = rejected-slave.py
config-filename = ${rejected-slave-json:rendered}
config-filename = ${rejected-slave-json:output}
config-state = empty
config-url = ${rejected-slave-publish:url}
......
......@@ -108,7 +108,7 @@ stop-on-error = True
ca_path='${kedifa-config:ca-certificate}',
crl_path='${kedifa-config:crl}',
key_path='${kedifa-csr:key}',
on_renew='${kedifa-reloader:rendered}',
on_renew='${kedifa-reloader:output}',
template_csr='${kedifa-csr:template-csr}'
)}}
......@@ -149,8 +149,8 @@ nginx_mime = {{ software_parameter_dict['nginx_mime'] }}
[expose-csr-template]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:expose-csr-etc}/nginx.conf
template = {{ software_parameter_dict['template_expose_csr_nginx_conf'] }}
output = ${directory:expose-csr-etc}/nginx.conf
url = {{ software_parameter_dict['template_expose_csr_nginx_conf'] }}
context =
section configuration expose-csr-configuration
......@@ -164,7 +164,7 @@ config-port = ${expose-csr-configuration:port}
[expose-csr]
recipe = slapos.cookbook:wrapper
command-line = {{ software_parameter_dict['nginx'] }}
-c ${expose-csr-template:rendered}
-c ${expose-csr-template:output}
url = https://[${expose-csr-configuration:ip}]:${expose-csr-configuration:port}
wrapper-path = ${directory:service}/expose-csr
......@@ -177,7 +177,7 @@ commands =
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
output = ${buildout:directory}/${:filename}
extra-context =
slapparameter_dict = {{ dumps(slapparameter_dict) }}
slap_software_type = {{ dumps(instance_parameter_dict['slap-software-type']) }}
......@@ -203,11 +203,10 @@ logfile = ${directory:log}/kedifa.log
[kedifa-reloader]
<= jinja2-template-base
template = {{ software_parameter_dict['template_wrapper'] }}
rendered = ${directory:etc-run}/kedifa-reloader
url = {{ software_parameter_dict['template_wrapper'] }}
output = ${directory:etc-run}/kedifa-reloader
command =
kill -HUP `cat ${kedifa-config:pidfile}`
mode = 0700
extra-context =
key content :command
......
......@@ -10,7 +10,7 @@ recipe = caddyprofiledeps
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
output = ${buildout:directory}/${:filename}
extensions = jinja2.ext.do
extra-context =
context =
......@@ -25,13 +25,13 @@ import-list =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-profile-caddy-replicate:rendered
default = dynamic-profile-caddy-replicate:output
RootSoftwareInstance = ${:default}
custom-personal = dynamic-profile-caddy-replicate:rendered
single-default = dynamic-profile-caddy-frontend:rendered
single-custom-personal = dynamic-profile-caddy-frontend:rendered
replicate = dynamic-profile-caddy-replicate:rendered
kedifa = dynamic-profile-kedifa:rendered
custom-personal = dynamic-profile-caddy-replicate:output
single-default = dynamic-profile-caddy-frontend:output
single-custom-personal = dynamic-profile-caddy-frontend:output
replicate = dynamic-profile-caddy-replicate:output
kedifa = dynamic-profile-kedifa:output
[software-parameter-section]
{% for key,value in software_parameter_dict.iteritems() %}
......@@ -40,7 +40,7 @@ kedifa = dynamic-profile-kedifa:rendered
[dynamic-profile-caddy-frontend]
< = jinja2-template-base
template = {{ software_parameter_dict['profile_caddy_frontend'] }}
url = {{ software_parameter_dict['profile_caddy_frontend'] }}
filename = instance-caddy-frontend.cfg
extra-context =
import furl_module furl
......@@ -49,7 +49,7 @@ extra-context =
[dynamic-profile-caddy-replicate]
< = jinja2-template-base
depends = ${caddyprofiledeps:recipe}
template = {{ software_parameter_dict['profile_caddy_replicate'] }}
url = {{ software_parameter_dict['profile_caddy_replicate'] }}
filename = instance-caddy-replicate.cfg
extra-context =
import subprocess_module subprocess
......@@ -61,7 +61,7 @@ extra-context =
[dynamic-profile-kedifa]
< = jinja2-template-base
template = {{ software_parameter_dict['profile_kedifa'] }}
url = {{ software_parameter_dict['profile_kedifa'] }}
filename = instance-kedifa.cfg
extra-context =
raw software_type kedifa
......
......@@ -61,8 +61,8 @@ eggs =
[profile-common]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-common.cfg.in
rendered = ${buildout:directory}/instance-common.cfg
url = ${:_profile_base_location_}/instance-common.cfg.in
output = ${buildout:directory}/instance-common.cfg
context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
......@@ -74,11 +74,11 @@ caucase_jinja2_library = ${caucase-jinja2-library:target}
# profiles
profile_caddy_frontend = ${profile-caddy-frontend:target}
profile_caddy_replicate = ${profile-caddy-replicate:target}
profile_common = ${profile-common:rendered}
profile_common = ${profile-common:output}
profile_kedifa = ${profile-kedifa:target}
profile_logrotate_base = ${template-logrotate-base:rendered}
profile_logrotate_base = ${template-logrotate-base:output}
profile_monitor = ${monitor-template:output}
profile_monitor2 = ${monitor2-template:rendered}
profile_monitor2 = ${monitor2-template:output}
profile_replicate_publish_slave_information = ${profile-replicate-publish-slave-information:target}
profile_slave_list = ${profile-slave-list:target}
......@@ -129,8 +129,8 @@ caucase_csr_sign_check = ${:bin_directory}/caucase-csr-sign-check
[template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
rendered = ${buildout:directory}/template.cfg
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/template.cfg
context =
section software_parameter_dict software-parameter-section
......
......@@ -290,8 +290,8 @@ command = {{ software_parameter_dict['htpasswd'] }} -cb ${:file} {{ slave_refere
{#- Store certificates on fs #}
[{{ cert_title }}]
< = jinja2-template-base
template = {{ empty_template }}
rendered = {{ cert_file }}
url = {{ empty_template }}
output = {{ cert_file }}
extra-context =
key content {{ cert_title + '-config:value' }}
{#- BBB: SlapOS Master non-zero knowledge BEGIN #}
......@@ -312,8 +312,8 @@ value = {{ dumps(slave_instance.get(cert_name)) }}
[{{cert_title}}]
< = jinja2-template-base
template = {{ empty_template }}
rendered = {{ cert_file }}
url = {{ empty_template }}
output = {{ cert_file }}
cert-content = {{ dumps(slave_instance.get('ssl_crt') + '\n' + slave_instance.get('ssl_ca_crt', '') + '\n' + slave_instance.get('ssl_key')) }}
extra-context =
key content :cert-content
......@@ -340,9 +340,9 @@ node-id = {{ node_id }}
[{{ slave_section_title }}]
< = jinja2-template-base
rendered = {{ caddy_configuration_directory }}/${:filename}
output = {{ caddy_configuration_directory }}/${:filename}
template = {{ template_default_slave_configuration }}
url = {{ template_default_slave_configuration }}
extra-context =
section slave_parameter {{ slave_configuration_section_name }}
......@@ -430,8 +430,8 @@ pid = {{ caddy_configuration['slave-introspection-pid-file'] }}
[slave-introspection-config]
<= jinja2-template-base
template = {{ software_parameter_dict['template_slave_introspection_httpd_nginx'] }}
rendered = {{ frontend_configuration['slave-introspection-configuration'] }}
url = {{ software_parameter_dict['template_slave_introspection_httpd_nginx'] }}
output = {{ frontend_configuration['slave-introspection-configuration'] }}
extra-context =
section slave_log_directory slave-log-directory-dict
section slave_htpasswd slave-htpasswd
......@@ -440,7 +440,7 @@ extra-context =
[slave-introspection]
recipe = slapos.cookbook:wrapper
command-line = {{ software_parameter_dict['nginx'] }}
-c ${slave-introspection-config:rendered}
-c ${slave-introspection-config:output}
wrapper-path = {{ directory['service'] }}/slave-instrospection-nginx
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
......@@ -491,18 +491,18 @@ update-command = ${:command}
[kedifa-updater-mapping]
recipe = slapos.recipe.template:jinja2
file = {{ kedifa_configuration['kedifa-updater-mapping-file'] }}
template = inline:
inline =
{%- for mapping in kedifa_updater_mapping %}
{{ mapping[0] }} {{ mapping[1] }} {{ mapping[2] }}
{%- endfor %}
rendered = ${:file}
output = ${:file}
##<Backend haproxy>
[backend-haproxy-configuration]
< = jinja2-template-base
template = {{ template_backend_haproxy_configuration }}
rendered = ${backend-haproxy-config:file}
url = {{ template_backend_haproxy_configuration }}
output = ${backend-haproxy-config:file}
backend_slave_list = {{ dumps(sorted(backend_slave_list)) }}
extra-context =
key backend_slave_list :backend_slave_list
......@@ -589,8 +589,8 @@ nginx_mime = {{ software_parameter_dict['nginx_mime'] }}
[expose-csr-template]
recipe = slapos.recipe.template:jinja2
rendered = {{ directory['expose-csr-etc'] }}/nginx.conf
template = {{ template_expose_csr_nginx_conf }}
output = {{ directory['expose-csr-etc'] }}/nginx.conf
url = {{ template_expose_csr_nginx_conf }}
context =
section configuration expose-csr-configuration
......@@ -604,7 +604,7 @@ config-port = ${expose-csr-configuration:port}
[expose-csr]
recipe = slapos.cookbook:wrapper
command-line = {{ software_parameter_dict['nginx'] }}
-c ${expose-csr-template:rendered}
-c ${expose-csr-template:output}
url = https://[${expose-csr-configuration:ip}]:${expose-csr-configuration:port}
wrapper-path = {{ directory['service'] }}/expose-csr
......
......@@ -19,4 +19,4 @@ md5sum = 2e7c1d8c553b398dd68c875a9fa38cdb
[instance]
filename = instance.cfg.jinja2
md5sum = 687ed460bebc18768ff7b7315e9b6de5
md5sum = b4a50217c68233eb0e2922fd7606a6be
......@@ -18,8 +18,8 @@ instance-caucased = {{ dumps(instance_caucased) }}
[caucased]
recipe = slapos.recipe.template:jinja2
template = ${context:instance-caucased}
rendered = ${buildout:parts-directory}/instance-caucased.cfg
url = ${context:instance-caucased}
output = ${buildout:parts-directory}/instance-caucased.cfg
monitor = {{ template_monitor }}
context =
key ipv6_set slap-configuration:ipv6
......@@ -31,6 +31,6 @@ import-list =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = caucased:rendered
default = caucased:output
# XXX: When will this name finally go away ?
RootSoftwareInstance = ${:default}
......@@ -14,12 +14,12 @@ url = ${:_profile_base_location_}/${:filename}
[instance]
recipe = slapos.recipe.template:jinja2
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
url = ${:_profile_base_location_}/${:filename}
context =
key bin_directory buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key caucase_jinja2_library caucase-jinja2-library:target
key instance_caucased instance-caucased:target
key template_monitor monitor2-template:rendered
key template_monitor monitor2-template:output
......@@ -14,8 +14,8 @@
# not need these here).
[template-cloudooo]
filename = instance.cfg.in
md5sum = e986de01a57161b32425f1cd3ccac924
md5sum = d1e4d7306c39f2ebc64d0407860d4301
[template-cloudooo-instance]
filename = instance-cloudooo.cfg.in
md5sum = 3e6830c21c206b3ae1140375e5e63b46
md5sum = 90299c1dbdc5f983613794a8e9a7bc9d
......@@ -43,9 +43,6 @@
{% set section_list = [] -%}
{% set cloudooo_section_list = [] -%}
{% macro cloudooo(name) %}{% do cloudooo_section_list.append(name) %}{{ name }}{% endmacro -%}
[simplefile]
recipe = slapos.recipe.template:jinja2
template = inline:{{ '{{ content }}' }}
{% macro simplefile(section_name, file_path, content, mode='') -%}
{% set content_section_name = section_name ~ '-content' -%}
......@@ -53,10 +50,9 @@ template = inline:{{ '{{ content }}' }}
content = {{ dumps(content) }}
[{{ section_name }}]
< = simplefile
rendered = {{ file_path }}
context = key content {{ content_section_name }}:content
mode = {{ mode }}
recipe = slapos.recipe.template
output = {{ file_path }}
inline = {{ '${' + content_section_name + ':content}' }}
{%- endmacro %}
......@@ -80,12 +76,12 @@ parts =
[apache]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/apache
command-line = "{{ parameter_dict['apache'] }}/bin/httpd" -f "${apache-conf:rendered}" -DFOREGROUND
command-line = "{{ parameter_dict['apache'] }}/bin/httpd" -f "${apache-conf:output}" -DFOREGROUND
[apache-conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-apache-conf'] }}
rendered = ${directory:apache-conf}/apache.conf
url = {{ parameter_dict['template-apache-conf'] }}
output = ${directory:apache-conf}/apache.conf
context = section parameter_dict apache-conf-parameter-dict
[apache-conf-parameter-dict]
......@@ -139,8 +135,8 @@ recipe = slapos.cookbook:publish.serialised
[fontconfig-conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-fonts-conf'] }}
rendered = ${directory:etc}/fonts.conf
url = {{ parameter_dict['template-fonts-conf'] }}
output = ${directory:etc}/fonts.conf
context =
key cachedir directory:fontconfig-cache
key fonts :fonts
......@@ -160,7 +156,7 @@ recipe = slapos.cookbook:generic.cloudooo
ip = {{ ipv4 }}
environment =
LD_LIBRARY_PATH = {{ parameter_dict['cairo'] }}/lib:{{ parameter_dict['cups'] }}/lib:{{ parameter_dict['cups'] }}/lib64:{{ parameter_dict['dbus'] }}/lib:{{ parameter_dict['dbus-glib'] }}/lib:{{ parameter_dict['file'] }}/lib:{{ parameter_dict['fontconfig'] }}/lib:{{ parameter_dict['freetype'] }}/lib:{{ parameter_dict['gcc'] }}/lib:{{ parameter_dict['gcc'] }}/lib64:{{ parameter_dict['glib'] }}/lib:{{ parameter_dict['glu'] }}/lib:{{ parameter_dict['libICE'] }}/lib:{{ parameter_dict['libSM'] }}/lib:{{ parameter_dict['libX11'] }}/lib:{{ parameter_dict['libXau'] }}/lib:{{ parameter_dict['libXdmcp'] }}/lib:{{ parameter_dict['libXext'] }}/lib:{{ parameter_dict['libXrender'] }}/lib:{{ parameter_dict['libexpat'] }}/lib:{{ parameter_dict['libffi'] }}/lib:{{ parameter_dict['libffi'] }}/lib64:{{ parameter_dict['libpng12'] }}/lib:{{ parameter_dict['libxcb'] }}/lib:{{ parameter_dict['mesa'] }}/lib:{{ parameter_dict['pixman'] }}/lib:{{ parameter_dict['xdamage'] }}/lib:{{ parameter_dict['xfixes'] }}/lib:{{ parameter_dict['zlib'] }}/lib
FONTCONFIG_FILE = ${fontconfig-conf:rendered}
FONTCONFIG_FILE = ${fontconfig-conf:output}
PATH = ${binary-link:target-directory}
LANG = C.UTF-8
mimetype_entry_addition =
......
......@@ -16,7 +16,7 @@ cert = ${slap-connection:cert-file}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extra-context =
context =
key ipv6_set slap-configuration:ipv6
......@@ -33,7 +33,7 @@ instance-parameter-dict = {{ dumps(cloudooo_parameter_dict) }}
[cloudooo-dynamic-template]
< = jinja2-template-base
template = {{ template_cloudooo_instance }}
url = {{ template_cloudooo_instance }}
filename = instance-cloudooo.cfg
extensions = jinja2.ext.do
extra-context =
......@@ -43,5 +43,5 @@ extra-context =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = cloudooo-dynamic-template:rendered
default = cloudooo-dynamic-template:output
RootSoftwareInstance = ${:default}
......@@ -27,9 +27,8 @@ cert = ${slap-connection:cert-file}
< = template-cloudooo-base
recipe = slapos.recipe.template:jinja2
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/${:filename}
mode = 640
output = ${buildout:directory}/template.cfg
url = ${:_profile_base_location_}/${:filename}
[template-cloudooo-base]
context =
......@@ -91,8 +90,8 @@ xfixes = ${xfixes:location}
xserver = ${xserver:location}
zlib = ${zlib:location}
template-apache-conf = ${template-apache-backend-conf:target}
template-logrotate-base = ${template-logrotate-base:rendered}
template-monitor = ${monitor2-template:rendered}
template-logrotate-base = ${template-logrotate-base:output}
template-monitor = ${monitor2-template:output}
[template-cloudooo-instance]
recipe = slapos.recipe.build:download
......
[instance.cfg]
filename = instance.cfg.in
md5sum = a24384487467a07e827edab17a0b7206
md5sum = 156dcfedd4b5fcbeefb3ac05a062edba
[runTestSuite.in]
_update_hash_filename_ = runTestSuite.in
......
......@@ -10,7 +10,7 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
[publish-env-path]
recipe = slapos.cookbook:publish
readme = Source the script to set up the environment.
script = ${cythonplus_env.sh:rendered}
script = ${cythonplus_env.sh:output}
repository = ${cythonplus-repository:repository}
[slap-configuration]
......@@ -34,12 +34,11 @@ shared = true
[runTestSuite]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
template = ${runTestSuite.in:target}
mode = 0755
output = $${directory:bin}/$${:_buildout_section_name_}
url = ${runTestSuite.in:target}
context =
key tmpdir directory:tmp
key slapparameter_dict slap-configuration:configuration
key cythonplus_repository cythonplus-repository:location
raw runTestSuite_interpreter ${runTestSuite_interpreter:bin-directory}/${runTestSuite_interpreter:interpreter}
raw cythonplus_env_sh ${cythonplus_env.sh:rendered}
raw cythonplus_env_sh ${cythonplus_env.sh:output}
[instance]
filename = instance.cfg
md5sum = ddd17fab15afa5a27cdc0761fbc8f34c
md5sum = a4e19280bc672cc98e0fef241c8439ba
......@@ -11,7 +11,7 @@ parts =
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
extends = ${monitor-template:rendered}
extends = ${monitor-template:output}
# parameters
[instance-parameter]
......
......@@ -14,8 +14,8 @@
# not need these here).
[template]
filename = instance.cfg
md5sum = 6dcbe21f99aa6675e8e3b74bc9cbb0e6
md5sum = 5bd72da73a8b84f70f568686924d7d6c
[template-default]
filename = instance-default.cfg.jinja.in
md5sum = 536a28ff250c691ca374f75aa5f0aa76
md5sum = 0c9ea9fa7417885889a536ec2cf2093f
......@@ -7,7 +7,7 @@ eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
extends = ${monitor2-template:rendered}
extends = ${monitor2-template:output}
parts =
testnode-service
......@@ -97,21 +97,20 @@ hash-files =
shell = ${bash:location}/bin/bash
[shellinabox]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template
# We cannot use slapos.cookbook:wrapper here because this recipe escapes too much
socket = $${directory:run}/siab.sock
mode = 0700
rendered = $${basedirectory:services}/shellinaboxd
template = inline:
output = $${basedirectory:services}/shellinaboxd
inline =
#!/bin/sh
exec ${shellinabox:location}/bin/shellinaboxd \
--unixdomain-only=$${:socket}:$(id -u):$(id -g):0600 \
--service "/:$(id -u):$(id -g):HOME:$${shell-environment:shell} -l"
[shellinabox-frontend-config]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/$${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = $${directory:etc}/$${:_buildout_section_name_}
inline =
https://$${:hostname}:$${:port} {
bind $${:ipv6}
tls self_signed
......@@ -131,15 +130,15 @@ username = testnode
passwd = $${pwgen:passwd}
cert-file = $${directory:shellinabox}/public.crt
key-file = $${directory:shellinabox}/private.key
url = https://$${:username}:$${:passwd}@$${:hostname}:$${:port}
backend-url = https://$${:username}:$${:passwd}@$${:hostname}:$${:port}
[shellinabox-frontend]
recipe = slapos.cookbook:wrapper
wrapper-path = $${rootdirectory:bin}/$${:_buildout_section_name_}
command-line =
${caddy:output} -conf $${shellinabox-frontend-config:rendered} -pidfile $${:pidfile}
url = $${shellinabox-frontend-config:url}
${caddy:output} -conf $${shellinabox-frontend-config:output} -pidfile $${:pidfile}
url = $${shellinabox-frontend-config:backend-url}
hostname = $${shellinabox-frontend-config:ipv6}
port = $${shellinabox-frontend-config:port}
pidfile = $${basedirectory:run}/$${:_buildout_section_name_}.pid
......@@ -152,7 +151,7 @@ command-line =
"kill -s USR1 $$(${coreutils:location}/bin/cat $${shellinabox-frontend:pidfile}) \
&& ${coreutils:location}/bin/sleep infinity"
hash-files =
$${shellinabox-frontend-config:rendered}
$${shellinabox-frontend-config:output}
$${shellinabox-frontend:wrapper-path}
[certificate-authority]
......
......@@ -17,12 +17,12 @@ cert = $${slap-connection:cert-file}
[switch_softwaretype]
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = $${:default}
default = instance-default:rendered
default = instance-default:output
[instance-default]
recipe = slapos.recipe.template:jinja2
template = ${template-default:output}
rendered = $${buildout:directory}/instance-default.cfg
url = ${template-default:output}
output = $${buildout:directory}/instance-default.cfg
context =
import json json
jsonkey default_parameter_dict :default-parameters
......
......@@ -36,13 +36,11 @@ eggs =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 0644
[template-default]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template-default.cfg.jinja
mode = 0644
[versions]
dnspython = 1.15.0
......
......@@ -15,4 +15,4 @@
[template-erp5testnode]
filename = instance.cfg.in
md5sum = bbfe2f0e83df4d6cd2120c0ef3c483cd
md5sum = 681f4159e4ac2542d0fbc7a894e43d79
......@@ -18,4 +18,4 @@ md5sum = 8357771b70efd0740561b1cb46f6955e
[template-deploy-test]
filename = instance.cfg.in
md5sum = c5db797980951b764b69aaa4b60a0380
md5sum = 9013ba5a4a2c80c7d96d0a6bfe0be0be
......@@ -25,24 +25,23 @@ command =
[runTestSuite]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/bin/$${:_buildout_section_name_}
template = inline:
output = $${buildout:directory}/bin/$${:_buildout_section_name_}
inline =
#!/bin/sh
export PATH=${python2.7-with-eggs:location}:$PATH
exec ${buildout:bin-directory}/${runTestSuite_py:interpreter} ${:_profile_base_location_}/runTestSuite.py --partition_ipv4 {{ list(partition_ipv4)[0] }} --partition_path $${buildout:directory} --test_reference "{{ slapparameter_dict.get('image-to-test-url') }} {{ slapparameter_dict.get('script-to-test-url')}}" --test_location "${test-location:base}/{{ slapparameter_dict.get('test-relative-directory', 'playbook/roles/standalone-shared') }}" --python_interpreter=${buildout:bin-directory}/${runTestSuite_py:interpreter} "$@"
mode = 0755
context =
key slapparameter_dict slap-configuration:configuration
key partition_ipv4 slap-configuration:ipv4
[switch_softwaretype]
default = $${:deploy-test}
deploy-test = dynamic-template-deploy-test:rendered
deploy-test = dynamic-template-deploy-test:output
[dynamic-template-deploy-test]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-deploy-test.cfg.jinja2
rendered = $${buildout:directory}/template-deploy-test.cfg
url = ${:_profile_base_location_}/instance-deploy-test.cfg.jinja2
output = $${buildout:directory}/template-deploy-test.cfg
context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
......@@ -52,4 +51,3 @@ context =
raw in_vm_test_script_md5 ${deploy-script-controller-script:md5sum}
raw waittime ${deploy-script-controller-script:waittime}
raw tries ${deploy-script-controller-script:tries}
mode = 0644
......@@ -69,4 +69,3 @@ location = ${:_profile_base_location_}/${:filename}
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 0644
......@@ -18,8 +18,8 @@ var = $${:home}/var
log = $${:var}/log
[log-writer]
recipe = slapos.recipe.template:jinja2
template = inline:#!/bin/sh
recipe = slapos.recipe.template
inline =
#!/bin/sh
echo "Hello : $(date)" >> $${directory:log}/log.log
rendered = $${directory:script}/log-writer
mode = 700
output = $${directory:script}/log-writer
......@@ -12,4 +12,3 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
md5sum = 9fccb9600a085691ab0f9a20cd615c01
mode = 0644
......@@ -6,12 +6,12 @@ default = $${:test}
RootSoftwareInstance = $${:test}
# Used for the test of resiliency. The system wants a "test" software_type.
test = dynamic-template-resilient-test:rendered
test = dynamic-template-resilient-test:output
[dynamic-template-resilient-test]
recipe = slapos.recipe.template:jinja2
template = ${template-resilient-test:target}
rendered = $${buildout:directory}/template-resilient-test.cfg
url = ${template-resilient-test:target}
output = $${buildout:directory}/template-resilient-test.cfg
bin-directory = ${buildout:bin-directory}
context =
key develop_eggs_directory buildout:develop-eggs-directory
......
......@@ -14,7 +14,7 @@
# not need these here).
[instance-profile]
filename = instance.cfg
md5sum = c265bf7ec199190ba9f77960cac5da38
md5sum = 41f5acc071609a0c4b5ada295ede6bac
[template-fluentd]
filename = instance-fluentd.cfg
......
......@@ -8,7 +8,7 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-template-fluentd:rendered
default = dynamic-template-fluentd:output
RootSoftwareInstance = $${:default}
[directory]
......@@ -29,11 +29,11 @@ cert = $${slap_connection:cert_file}
[dynamic-template-fluentd]
recipe = slapos.recipe.template:jinja2
template = ${template-fluentd:output}
rendered = $${buildout:directory}/instance-fluentd.cfg
url = ${template-fluentd:output}
output = $${buildout:directory}/instance-fluentd.cfg
extensions = jinja2.ext.do
context =
key fluentd_agent_conf fluentd-agent-conf:rendered
key fluentd_agent_conf fluentd-agent-conf:output
key port_list fluentd-conf:port-list
section directory directory
......@@ -46,9 +46,6 @@ init =
options['port-list'] = re.findall(r'<source>.*port (\d+).*<\/source>', options['text'], re.DOTALL)
[fluentd-agent-conf]
recipe = slapos.recipe.template:jinja2
template = inline:{{ conf }}
rendered = $${directory:etc}/fluentd-agent.conf
mode = 0644
context =
key conf fluentd-conf:text
recipe = slapos.recipe.template
inline = $${fluentd-conf:text}
output = $${directory:etc}/fluentd-agent.conf
......@@ -15,7 +15,6 @@ part = python3
[template-base]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
mode = 0644
[instance-profile]
< = template-base
......
......@@ -15,4 +15,4 @@
[instance-cfg]
filename = instance.cfg.in
md5sum = c24f3241af0123c9570a60ccc0fb8fdc
md5sum = 38c79a4952a7cb63698135f1d1ed6c8c
......@@ -51,34 +51,35 @@ storage-path = $${directory:data}/.passwd
username = admin
[stat-password]
recipe = slapos.recipe.template:jinja2
template = inline:
recipe = slapos.recipe.template
inline =
$${admin-password:username}:$${admin-password:passwd}
rendered = $${directory:data}/passwd
output = $${directory:data}/passwd
[ice-servers.json]
recipe = slapos.recipe.template:jinja2
template = inline:
recipe = slapos.recipe.template
inline =
$${slap-configuration:configuration.ice-servers.json}
rendered = $${directory:data}/ice-servers.json
output = $${directory:data}/ice-servers.json
[groups-json]
recipe = slapos.recipe.template:jinja2
template = inline:{
recipe = slapos.recipe.template
inline =
{
"public":true,
"op": [{"username":"$${admin-password:username}","password":"$${admin-password:passwd}"}],
"other": [],
"presenter": [{"username": "", "password": "nexedi"}]
}
rendered = $${directory:groups}/public.json
output = $${directory:groups}/public.json
[galene-wrapper]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template
port = 8443
ip = $${slap-configuration:ipv6-random}
template =
inline:#!/bin/sh
inline =
#!/bin/sh
ulimit -n $(ulimit -Hn)
exec ${gowork:bin}/galene \
-static ${galene:location}/static \
......@@ -87,7 +88,7 @@ template =
-data $${directory:data} \
-http [$${:ip}]:$${:port} \
-turn ""
rendered = $${directory:services}/galene
output = $${directory:services}/galene
depends =
$${ice-servers.json:recipe}
$${groups-json:recipe}
......
......@@ -14,7 +14,7 @@
# not need these here).
[instance.cfg]
filename = instance.cfg.in
md5sum = 47e8092404feaf3f28ee6469523689ac
md5sum = 8e8edd7dadb9c331fdba826312e7e8d2
[watcher]
_update_hash_filename_ = watcher.in
......@@ -42,7 +42,7 @@ md5sum = 52d18b521b8cd16352fc88b1e1d79d53
[gitlab-unicorn-startup.in]
_update_hash_filename_ = gitlab-unicorn-startup.in
md5sum = aff91edaf9786c213db8ea703ab3571e
md5sum = b0c3d465a8aaad9d2274934dcf208645
[gitlab.yml.in]
_update_hash_filename_ = template/gitlab.yml.in
......@@ -54,11 +54,11 @@ md5sum = 0f1ec4077dab586cc003ae13f689eda2
[instance-gitlab.cfg.in]
_update_hash_filename_ = instance-gitlab.cfg.in
md5sum = f099d01baefe41c8f0944c2437b30881
md5sum = c115c88d5798dcb5e16b9d50432f2551
[instance-gitlab-export.cfg.in]
_update_hash_filename_ = instance-gitlab-export.cfg.in
md5sum = 2af7dcf63f74e5edc53a3ff11fa4989b
md5sum = da2e3d6f67c92233d370dae55fb3b35f
[instance-gitlab-test.cfg.in]
_update_hash_filename_ = instance-gitlab-test.cfg.in
......
......@@ -73,5 +73,5 @@ $RAKE cache:clear || die "cache:clear failed"
# 3. finally exec to unicorn
exec {{ gitlab_unicorn }} \
-E production \
-c {{ unicorn_rb.rendered }} \
-c {{ unicorn_rb.output }} \
{{ gitlab_work.location }}/config.ru
......@@ -60,8 +60,8 @@ output = ${directory:srv}/exporter.exclude
# this section should be added only on runner import instance
recipe = slapos.recipe.template:jinja2
mode = 0700
template= {{ gitlab_restore_sh_in }}
rendered= ${directory:srv}/runner-import-restore
url = {{ gitlab_restore_sh_in }}
output= ${directory:srv}/runner-import-restore
context =
raw bash_bin {{ bash_bin }}
raw go_work_bin {{ gopath_bin }}
......
......@@ -198,29 +198,29 @@ context-extra =
[gitlab-etc-template]
<= etc-template
rendered= ${gitlab:etc}/${:_buildout_section_name_}
output= ${gitlab:etc}/${:_buildout_section_name_}
[nginx-etc-template]
<= etc-template
rendered= ${nginx:etc}/${:_buildout_section_name_}
output= ${nginx:etc}/${:_buildout_section_name_}
[database.yml]
<= gitlab-etc-template
template= {{ database_yml_in }}
url = {{ database_yml_in }}
context-extra =
section pgsql service-postgresql
[gitconfig]
<= etc-template
template= {{ gitconfig_in }}
url = {{ gitconfig_in }}
# NOTE put directly into $HOME/ - this way git will pick it up
rendered= ${directory:home}/.${:_buildout_section_name_}
output= ${directory:home}/.${:_buildout_section_name_}
[gitlab-shell-config.yml]
<= etc-template
template= {{ gitlab_shell_config_yml_in }}
rendered= ${gitlab-shell:etc}/config.yml
url = {{ gitlab_shell_config_yml_in }}
output= ${gitlab-shell:etc}/config.yml
context-extra =
import urllib urllib
section gitlab gitlab
......@@ -232,7 +232,7 @@ context-extra =
[gitlab.yml]
<= gitlab-etc-template
template= {{ gitlab_yml_in }}
url = {{ gitlab_yml_in }}
context-extra =
import urllib urllib
section gitlab gitlab
......@@ -242,16 +242,16 @@ context-extra =
[nginx.conf]
<= nginx-etc-template
template= {{ nginx_conf_in }}
url = {{ nginx_conf_in }}
context-extra =
section directory directory
section gitlab_workhorse gitlab-workhorse
raw nginx_mime_types {{ nginx_mime_types }}
raw nginx_gitlab_http_conf ${nginx-gitlab-http.conf:rendered}
raw nginx_gitlab_http_conf ${nginx-gitlab-http.conf:output}
[nginx-gitlab-http.conf]
<= nginx-etc-template
template= {{ nginx_gitlab_http_conf_in }}
url = {{ nginx_gitlab_http_conf_in }}
context-extra =
section nginx nginx
section gitlab_work gitlab-work
......@@ -259,8 +259,8 @@ context-extra =
[gitaly-config.toml]
<= etc-template
template= {{ gitaly_config_toml_in }}
rendered= ${directory:etc}/${:_buildout_section_name_}
url = {{ gitaly_config_toml_in }}
output= ${directory:etc}/${:_buildout_section_name_}
context-extra =
import urllib urllib
section gitlab gitlab
......@@ -269,23 +269,23 @@ context-extra =
[rack_attack.rb]
<= gitlab-etc-template
template = {{ rack_attack_rb_in }}
url = {{ rack_attack_rb_in }}
[resque.yml]
<= gitlab-etc-template
template= {{ resque_yml_in }}
url = {{ resque_yml_in }}
context-extra =
section redis service-redis
[smtp_settings.rb]
<= gitlab-etc-template
template= {{ smtp_settings_rb_in }}
url = {{ smtp_settings_rb_in }}
# contains smtp password
mode = 0600
[unicorn.rb]
<= gitlab-etc-template
template = {{ unicorn_rb_in }}
url = {{ unicorn_rb_in }}
context-extra =
section unicorn unicorn
section directory directory
......@@ -320,8 +320,8 @@ prog = {{ prog }}
[gitlab-unicorn-startup]
recipe = slapos.recipe.template:jinja2
mode = 0755
template= {{ gitlab_unicorn_startup_in }}
rendered= ${directory:bin}/${:_buildout_section_name_}
url = {{ gitlab_unicorn_startup_in }}
output= ${directory:bin}/${:_buildout_section_name_}
context =
raw bash_bin {{ bash_bin }}
raw gitlab_rake ${gitlab-rake:wrapper-path}
......@@ -397,15 +397,15 @@ tune-command =
ln -sf ${gitlab-workhorse:secret} .gitlab_workhorse_secret
# config/
cd config &&
ln -sf ${unicorn.rb:rendered} unicorn.rb &&
ln -sf ${gitlab.yml:rendered} gitlab.yml &&
ln -sf ${database.yml:rendered} database.yml &&
ln -sf ${resque.yml:rendered} resque.yml &&
ln -sf ${unicorn.rb:output} unicorn.rb &&
ln -sf ${gitlab.yml:output} gitlab.yml &&
ln -sf ${database.yml:output} database.yml &&
ln -sf ${resque.yml:output} resque.yml &&
ln -sf ${secrets:secrets}/gitlab_secrets.yml secrets.yml &&
# config/initializers/
cd initializers &&
ln -sf ${rack_attack.rb:rendered} rack_attack.rb &&
ln -sf ${smtp_settings.rb:rendered} smtp_settings.rb &&
ln -sf ${rack_attack.rb:output} rack_attack.rb &&
ln -sf ${smtp_settings.rb:output} smtp_settings.rb &&
# public/
cd ../../public &&
rm -rf uploads assets &&
......@@ -420,7 +420,7 @@ tune-command =
software = {{ gitlab_shell_repository_location }}
tune-command =
ln -sf ${gitlab-shell-config.yml:rendered} config.yml &&
ln -sf ${gitlab-shell-config.yml:output} config.yml &&
true
......@@ -597,7 +597,7 @@ wrapper-path = ${directory:service}/unicorn
# NOTE we perform db setup / migrations as part of unicorn startup.
# Those operations require PG and Redis to be up and running already, that's
# why we do it here. See gitlab-unicorn-startup for details.
command-line = ${gitlab-unicorn-startup:rendered}
command-line = ${gitlab-unicorn-startup:output}
depend =
${promise-unicorn:recipe}
......@@ -757,7 +757,7 @@ symlink = ${nginx:log} = ${nginx:srv}/logs
[service-nginx]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:service}/nginx
command-line = {{ nginx_bin }} -p ${nginx:srv} -c ${nginx.conf:rendered}
command-line = {{ nginx_bin }} -p ${nginx:srv} -c ${nginx.conf:output}
depend =
${nginx-symlinks:recipe}
${promise-nginx:recipe}
......@@ -796,7 +796,7 @@ cron-entries = ${cron:cron-entries}
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:service}/gitaly
#command-line = ${gitlab-work:location}/bin/daemon_with_pidfile ${gitaly:pid}
command-line = {{ gitaly_location }}/gitaly ${gitaly-config.toml:rendered}
command-line = {{ gitaly_location }}/gitaly ${gitaly-config.toml:output}
environment =
PATH={{ bundler_1_17_3_dir }}:{{ ruby_location }}/bin:/bin:/usr/bin
......
......@@ -13,9 +13,9 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
gitlab = instance-gitlab.cfg:rendered
gitlab-export = instance-gitlab-export.cfg:rendered
gitlab-test = instance-gitlab-test.cfg:rendered
gitlab = instance-gitlab.cfg:output
gitlab-export = instance-gitlab-export.cfg:output
gitlab-test = instance-gitlab-test.cfg:output
RootSoftwareInstance = $${:gitlab}
# TODO -import, -pull-backup
......@@ -56,7 +56,7 @@ configuration.icp_license =
[instance-cfg]
recipe = slapos.recipe.template:jinja2
mode = 0644
rendered= $${buildout:directory}/$${:_buildout_section_name_}
output= $${buildout:directory}/$${:_buildout_section_name_}
context =
import os os
import pwd pwd
......@@ -79,7 +79,7 @@ context =
raw git ${git:location}/bin/git
raw git_location ${git:location}
raw gitaly_location ${gitaly-repository:location}
raw gitlab_export ${gitlab-export:rendered}
raw gitlab_export ${gitlab-export:output}
raw gitlab_workhorse ${gowork:bin}/gitlab-workhorse
raw gopath_bin ${gowork:bin}
raw gunzip_bin ${gzip:location}/bin/gunzip
......@@ -95,14 +95,14 @@ context =
raw redis_binprefix ${redis28:location}/bin
raw ruby_location ${bundler-4gitlab:ruby-location}
raw tar_location ${tar:location}
raw watcher ${watcher:rendered}
raw watcher ${watcher:output}
raw xnice_repository_location ${xnice-repository:location}
raw yarn_location ${yarn:location}
# config files
raw database_yml_in ${database.yml.in:target}
raw gitconfig_in ${gitconfig.in:target}
raw monitor_template ${monitor2-template:rendered}
raw monitor_template ${monitor2-template:output}
raw gitlab_shell_config_yml_in ${gitlab-shell-config.yml.in:target}
raw gitlab_unicorn_startup_in ${gitlab-unicorn-startup.in:target}
raw gitlab_yml_in ${gitlab.yml.in:target}
......@@ -121,18 +121,18 @@ context-extra =
[instance-gitlab.cfg]
<= instance-cfg
template= ${instance-gitlab.cfg.in:target}
url = ${instance-gitlab.cfg.in:target}
[instance-gitlab-export.cfg]
<= instance-cfg
template= ${instance-gitlab-export.cfg.in:target}
url = ${instance-gitlab-export.cfg.in:target}
context-extra =
raw instance_gitlab_cfg $${instance-gitlab.cfg:rendered}
raw instance_gitlab_cfg $${instance-gitlab.cfg:output}
[instance-gitlab-test.cfg]
<= instance-cfg
template= ${instance-gitlab-test.cfg.in:target}
url = ${instance-gitlab-test.cfg.in:target}
context-extra =
raw instance_gitlab_cfg $${instance-gitlab.cfg:rendered}
raw instance_gitlab_export_cfg $${instance-gitlab-export.cfg:rendered}
raw instance_gitlab_cfg $${instance-gitlab.cfg:output}
raw instance_gitlab_export_cfg $${instance-gitlab-export.cfg:output}
raw gitlab_demo_backup_path ${gitlab-demo-backup.git:location}
......@@ -319,8 +319,8 @@ output = ${buildout:directory}/instance.cfg
# macro: download a shell script and put it rendered into <software>/bin/
[binsh]
recipe = slapos.recipe.template:jinja2
template= ${:_profile_base_location_}/${:_update_hash_filename_}
rendered= ${buildout:bin-directory}/${:_buildout_section_name_}
url = ${:_profile_base_location_}/${:_update_hash_filename_}
output= ${buildout:bin-directory}/${:_buildout_section_name_}
mode = 0755
context =
section bash bash
......
......@@ -15,7 +15,7 @@
[instance-profile]
filename = instance.cfg.in
md5sum = 3ccdd2299e759488545b62368c7a0b91
md5sum = 6fb42f5663864789ff7b375a9a86888e
[influxdb-config-file]
filename = influxdb-config-file.cfg.in
......
......@@ -67,9 +67,8 @@ common-name = ${:_buildout_section_name_}
[config-file]
recipe = slapos.recipe.template:jinja2
template = {{ buildout['parts-directory'] }}/${:_buildout_section_name_}/${:_buildout_section_name_}.cfg.in
rendered = ${directory:etc}/${:_buildout_section_name_}.cfg
mode = 0644
url = {{ buildout['parts-directory'] }}/${:_buildout_section_name_}/${:_buildout_section_name_}.cfg.in
output = ${directory:etc}/${:_buildout_section_name_}.cfg
extensions = jinja2.ext.do
[check-port-listening-promise]
......@@ -100,7 +99,7 @@ database = telegraf
recipe = slapos.cookbook:wrapper
command-line =
nice -19 chrt --idle 0 ionice -c3 {{ influxd_bin }} -config ${influxdb-config-file:rendered}
nice -19 chrt --idle 0 ionice -c3 {{ influxd_bin }} -config ${influxdb-config-file:output}
wrapper-path = ${directory:service}/influxdb
[influxdb-config-file]
......@@ -158,7 +157,7 @@ ssl-cert-file = ${grafana-certificate:cert-file}
recipe = slapos.cookbook:wrapper
command-line =
{{ grafana_bin }} -config ${grafana-config-file:rendered} -homepath {{ grafana_homepath }}
{{ grafana_bin }} -config ${grafana-config-file:output} -homepath {{ grafana_homepath }}
wrapper-path = ${directory:service}/grafana
[grafana-certificate]
......@@ -178,11 +177,11 @@ context =
section apache_frontend apache-frontend
key slapparameter_dict slap-configuration:configuration
depends =
${grafana-provisioning-config-file:rendered}
${grafana-provisioning-config-file:output}
[grafana-provisioning-config-file]
<= config-file
rendered = ${grafana:provisioning-datasources-dir}/datasource.yaml
output = ${grafana:provisioning-datasources-dir}/datasource.yaml
context =
section influxdb influxdb
section loki loki
......@@ -199,7 +198,7 @@ recipe = slapos.cookbook:wrapper
extra-config-dir = ${directory:telegraf-extra-config-dir}
# telegraf needs influxdb to be already listening before starting
command-line =
bash -c '${influxdb-listen-promise:path} && nice -19 chrt --idle 0 ionice -c3 {{ telegraf_bin }} --config ${telegraf-config-file:rendered} --config-directory ${:extra-config-dir}'
bash -c '${influxdb-listen-promise:path} && nice -19 chrt --idle 0 ionice -c3 {{ telegraf_bin }} --config ${telegraf-config-file:output} --config-directory ${:extra-config-dir}'
wrapper-path = ${directory:service}/telegraf
[telegraf-config-file]
......@@ -212,7 +211,7 @@ context =
[loki]
recipe = slapos.cookbook:wrapper
command-line =
bash -c 'nice -19 chrt --idle 0 ionice -c3 {{ loki_bin }} -config.file=${loki-config-file:rendered}'
bash -c 'nice -19 chrt --idle 0 ionice -c3 {{ loki_bin }} -config.file=${loki-config-file:output}'
wrapper-path = ${directory:service}/loki
storage-boltdb-dir = ${directory:loki-storage-boltdb-dir}
......@@ -235,7 +234,7 @@ url = ${loki:url}/ready
[promtail]
recipe = slapos.cookbook:wrapper
command-line =
bash -c 'nice -19 chrt --idle 0 ionice -c3 {{ promtail_bin }} -config.file=${promtail-config-file:rendered}'
bash -c 'nice -19 chrt --idle 0 ionice -c3 {{ promtail_bin }} -config.file=${promtail-config-file:output}'
wrapper-path = ${directory:service}/promtail
dir = ${directory:promtail-dir}
......
......@@ -117,9 +117,8 @@ url = ${:_profile_base_location_}/${:filename}
[instance-profile]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/instance.cfg
mode = 0644
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
......
[template-cfg]
filename = instance.cfg.in
md5sum = 5dfeeb5eca125dcaa5f9e537f941dd41
md5sum = 4d73fe3c5d286163974bdb79c838e030
[instance-headless-chromium]
_update_hash_filename_ = instance-headless-chromium.cfg.in
md5sum = 7392d20e48dbc599eb8e9d02e8095bbf
md5sum = d72e5f6e159081f1c204ceb7ec0c0caf
[template-nginx-conf]
_update_hash_filename_ = templates/nginx.conf.in
......
......@@ -54,31 +54,30 @@ nginx-mime-types = ${directory:etc}/mime-types
# Create a launcher script in /etc/service for the headless shell
# executable.
[chromium-launcher]
recipe = slapos.recipe.template:jinja2
template =
inline:#!/bin/sh
recipe = slapos.recipe.template
inline =
#!/bin/sh
export FONTCONFIG_FILE=${font-config:rendered}
export FONTCONFIG_FILE=${font-config:output}
exec {{ parameter_list['chromium-wrapper'] }} \
--remote-debugging-address=${headless-chromium:ipv4} \
--remote-debugging-port=${headless-chromium:remote-debugging-port} \
${headless-chromium:url}
rendered = ${directory:service}/chromium
output = ${directory:service}/chromium
# Configure and launch the proxy server.
[nginx-config]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template-nginx-config'] }}
rendered = ${headless-chromium:nginx-config-target}
mode = 700
url = {{ parameter_list['template-nginx-config'] }}
output = ${headless-chromium:nginx-config-target}
context =
section param_headless_chromium headless-chromium
[nginx-mime-types]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template-mime-types'] }}
rendered = ${headless-chromium:nginx-mime-types}
recipe = slapos.recipe.template
url = {{ parameter_list['template-mime-types'] }}
output = ${headless-chromium:nginx-mime-types}
[nginx-launcher]
recipe = slapos.cookbook:wrapper
......@@ -128,8 +127,8 @@ environment =
# Generate a fonts.conf file.
[font-config]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template-fonts-conf'] }}
rendered = ${directory:etc}/fonts.conf
url = {{ parameter_list['template-fonts-conf'] }}
output = ${directory:etc}/fonts.conf
context =
key cachedir :cache-dir
key fonts :fonts
......
......@@ -20,8 +20,8 @@ template-mime-types = {{ template_mime_types_target }}
[instance-headless-chromium]
recipe = slapos.recipe.template:jinja2
template = {{ template_instance_headless_chromium_target }}
rendered = ${buildout:directory}/${:filename}
url = {{ template_instance_headless_chromium_target }}
output = ${buildout:directory}/${:filename}
filename = instance-headless-chromium.cfg
context =
section buildout buildout
......@@ -41,7 +41,7 @@ default-parameters =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = ${:default}
default = instance-headless-chromium:rendered
default = instance-headless-chromium:output
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
......
......@@ -18,22 +18,21 @@ part = python3
[template-cfg]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/${:filename}
mode = 0644
output = ${buildout:directory}/template.cfg
url = ${:_profile_base_location_}/${:filename}
context =
section buildout buildout
key openssl_location openssl:location
key nginx_location nginx:location
key liberation_fonts_location liberation-fonts:location
key fontconfig_location fontconfig:location
key chromium_wrapper headless-chromium-wrapper:rendered
key chromium_wrapper headless-chromium-wrapper:output
key devtools_frontend headless-chromium:devtools-frontend
key template_nginx_config_target template-nginx-conf:target
key template_mime_types_target template-mime-types:target
key template_fonts_conf_target template-fonts-conf:output
key template_instance_headless_chromium_target instance-headless-chromium:target
key template_monitor monitor2-template:rendered
key template_monitor monitor2-template:output
[download-base]
recipe = slapos.recipe.build:download
......
......@@ -14,7 +14,7 @@ cert = ${slap-connection:cert-file}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
filename = ${:_buildout_section_name_}.cfg
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extensions = jinja2.ext.do
extra-context =
context =
......@@ -24,7 +24,7 @@ context =
[root]
<= jinja2-template-base
template = {{ instance_root }}
url = {{ instance_root }}
extra-context =
import urlparse urlparse
key ipv6 slap-configuration:ipv6-random
......@@ -32,14 +32,14 @@ extra-context =
[server]
<= jinja2-template-base
template = {{ instance_server }}
url = {{ instance_server }}
extra-context =
key instance_guid slap-configuration:instance-guid
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
override = {{ dumps(override_switch_softwaretype |default) }}
default = root:rendered
default = root:output
# BBB
RootSoftwareInstance = ${:default}
server = server:rendered
server = server:output
......@@ -16,10 +16,10 @@ environment +=
[template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
url = ${:_profile_base_location_}/instance.cfg.in
md5sum = d7506e861ef87977eaa554b8928d2c99
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
output = ${buildout:directory}/template.cfg
context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
......
......@@ -39,8 +39,7 @@ golang = ${golang1.17:location}
# in the section using this template
[jinja-template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
mode = 0644
url = ${:_profile_base_location_}/${:filename}
# Download instance.cfg.in (buildout profile used to deployment of instance),
# replace all ${foo:bar} parameters by real values, and change $${foo:bar} to
......@@ -49,10 +48,10 @@ mode = 0644
[instance-profile]
# The <= is buildout verb to use defined template
<= jinja-template
rendered = ${buildout:directory}/instance.cfg
output = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
raw template_monitor ${monitor2-template:rendered}
raw template_monitor ${monitor2-template:output}
# md5sum is fetched from buildout.hash.cfg and can be recalculated automatically by
# calling update-hash
......@@ -15,8 +15,8 @@ template_launcher = {{ template_launcher_target }}
[instance-html5as]
recipe = slapos.recipe.template:jinja2
template = {{ template_instance_html5as_target }}
rendered = ${buildout:directory}/${:filename}
url = {{ template_instance_html5as_target }}
output = ${buildout:directory}/${:filename}
filename = instance-html5as.cfg
context =
section buildout buildout
......@@ -27,7 +27,7 @@ context =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = ${:default}
default = instance-html5as:rendered
default = instance-html5as:output
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
......
......@@ -99,25 +99,24 @@ path_nginx = {{ parameter_list['nginx_location'] }}/sbin/nginx
# Render nginx conf
[nginx_conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_nginx_conf'] }}
rendered = ${html5as:path_nginx_conf}
context =
url = {{ parameter_list['template_nginx_conf'] }}
output = ${html5as:path_nginx_conf}
context =
section param_html5as html5as
section param_tempdir tempdirectory
# Render necessary mime types file for nginx
[mime_types]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_mime_types'] }}
rendered = ${html5as:path_mime_types}
recipe = slapos.recipe.template
url = {{ parameter_list['template_mime_types'] }}
output = ${html5as:path_mime_types}
# Render the script launching nginx
[launcher]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_launcher'] }}
rendered = ${html5as:bin_launcher}
mode = 700
context =
url = {{ parameter_list['template_launcher'] }}
output = ${html5as:bin_launcher}
context =
section param_html5as html5as
# Simple command to put content in the docroot
......
......@@ -24,10 +24,10 @@ parts =
# The recipe, template and mode are fetched from jijna-template
[template-cfg]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
url = ${:_profile_base_location_}/${:filename}
filename = instance.cfg.in
md5sum = 310aab063704794065ee3bc8f81fdc70
md5sum = 861e7ce5d65252067d31c7325c97917d
context =
section buildout buildout
key nginx_location nginx:location
......@@ -42,7 +42,7 @@ context =
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
_update_hash_filename_ = instance_html5as.cfg.in
md5sum = 9b7ed68551cac5967915979383238669
md5sum = 2c2bcd723694bc88df13c139c96e8bad
[template_nginx_conf]
recipe = slapos.recipe.build:download
......
......@@ -17,11 +17,11 @@
[template-cfg]
filename = instance.cfg.in
md5sum = 9e486efe4ab1aba8cb72b04f6c6da8ad
md5sum = ef264514b64a4b2c77c9965c587c6d34
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
md5sum = f86b2f37c0acd21ca1f41d90c5477d75
md5sum = a48e0026e2b949cc334efcb21478a6ed
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
......
......@@ -18,8 +18,8 @@ template_monitor = {{ template_monitor }}
[instance-html5as]
recipe = slapos.recipe.template:jinja2
template = {{ template_instance_html5as_target }}
rendered = ${buildout:directory}/${:filename}
url = {{ template_instance_html5as_target }}
output = ${buildout:directory}/${:filename}
filename = instance-html5as.cfg
context =
section buildout buildout
......@@ -40,8 +40,8 @@ default-parameters =
[instance-replicate]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
template = {{ template_instance_replicate }}
rendered = ${buildout:directory}/${:filename}
url = {{ template_instance_replicate }}
output = ${buildout:directory}/${:filename}
filename = instance-replicate-html5as.cfg
context =
section buildout buildout
......@@ -57,8 +57,8 @@ default-parameters =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = ${:default}
default = instance-html5as:rendered
replicate = instance-replicate:rendered
default = instance-html5as:output
replicate = instance-replicate:output
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
......
......@@ -107,25 +107,24 @@ path_nginx = {{ parameter_list['nginx_location'] }}/sbin/nginx
# Render nginx conf
[nginx_conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_nginx_conf'] }}
rendered = ${html5as:path_nginx_conf}
context =
url = {{ parameter_list['template_nginx_conf'] }}
output = ${html5as:path_nginx_conf}
context =
section param_html5as html5as
section param_tempdir tempdirectory
# Render necessary mime types file for nginx
[mime_types]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_mime_types'] }}
rendered = ${html5as:path_mime_types}
recipe = slapos.recipe.template
url = {{ parameter_list['template_mime_types'] }}
output = ${html5as:path_mime_types}
# Render the script launching nginx
[launcher]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_launcher'] }}
rendered = ${html5as:bin_launcher}
mode = 700
context =
url = {{ parameter_list['template_launcher'] }}
output = ${html5as:bin_launcher}
context =
section param_html5as html5as
# Command to put content in the docroot
......@@ -137,7 +136,7 @@ location = ${directory:srv}/html5as
# All the keys in this section will be available as a dict called "self.options"
# We add: or '', otherwise jinja2 will render a 'None' string
url = {{ parameter_dict['download_url'] or '' }}
default_index_html = ${default_index_html:rendered}
default_index_html = ${default_index_html:output}
# If a tarball is passed as a parameter in download url
# it's content will be served by the instance.
# If the parameter is not provided it fallback to the default template
......@@ -167,8 +166,8 @@ install =
[default_index_html]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_index_html'] }}
rendered = ${directory:srv}/index.html
url = {{ parameter_list['template_index_html'] }}
output = ${directory:srv}/index.html
title = {{ parameter_dict['title'] }}
context =
key title :title
......@@ -176,9 +175,8 @@ context =
### Nginx Graceful
[nginx-graceful]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_graceful'] }}
rendered = ${basedirectory:script}/nginx-graceful
mode = 0700
url = {{ parameter_list['template_graceful'] }}
output = ${basedirectory:script}/nginx-graceful
context =
section param_html5as html5as
......
......@@ -27,8 +27,8 @@ parts =
# The recipe, template and mode are fetched from jijna-template
[template-cfg]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
url = ${:_profile_base_location_}/${:filename}
context =
section buildout buildout
key nginx_location nginx:location
......@@ -41,7 +41,7 @@ context =
key template_graceful_target template_graceful:target
key template_instance_replicate template_instance_replicate:target
# Monitor stack also provides a template for the instance
key template_monitor monitor2-template:rendered
key template_monitor monitor2-template:output
# Have one shared section to define the default behaviour to download
# templates. Sections inheriting from this one won't need to redefine
......
......@@ -22,8 +22,8 @@ md5sum = 87781e6bcb523bb8434888d5f984f36c
[template-validator]
filename = instance-validator.cfg.in
md5sum = dc8b8d03b0af9cd32398d1fe86267bb7
md5sum = 3733c484371115831721341f9b65dc0f
[template]
filename = instance.cfg.in
md5sum = c5b18ea5d353f96c41294541186f2528
md5sum = c86d4c6b5cc67139810399b1032c3410
......@@ -40,15 +40,13 @@ pass = insecure
recipe = slapos.recipe.template
url = ${template-tomcat-service:output}
output = $${basedirectory:services}/tomcat
mode = 0700
virtual-depends =
virtual-depends =
$${tomcat-configuration:ip}
[tomcat-configuration]
recipe = slapos.recipe.template
url = ${template-tomcat-configuration:output}
output = $${basedirectory:catalina_conf}/server.xml
mode = 0600
ip = {{ partition_ipv6 }}
port = 8899
scheme = https
......@@ -74,7 +72,7 @@ monitor-httpd-port = 8333
# Add parts generated by template
[buildout]
extends =
${monitor-template:rendered}
${monitor-template:output}
parts =
publish-url
tomcat-service
......
......@@ -8,8 +8,8 @@ offline = true
[dynamic-template-validator]
recipe = slapos.recipe.template:jinja2
template = ${template-validator:output}
rendered = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filename}
url = ${template-validator:output}
output = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filename}
filename = instance-validator.cfg
context =
# partition_ipv6 is the random ipv6 allocated to the local partition
......@@ -19,7 +19,7 @@ context =
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = $${:validator}
default = $${:validator}
validator = dynamic-template-validator:rendered
validator = dynamic-template-validator:output
[slap-configuration]
# Fetches parameters defined in SlapOS Master for this instance.
......
......@@ -22,13 +22,11 @@ parts =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
[template-tomcat-service]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
mode = 0644
##########################################################
# Buildout instance.cfg templates
......@@ -37,13 +35,11 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template-validator.cfg
mode = 0644
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 0644
[versions]
# 1.3.4nxd2 is invalid version string, thus pached version string is not '1.3.4nxd2+SlapOSPatched001'
......
......@@ -15,7 +15,7 @@
[template-cfg]
filename = instance.cfg.in
md5sum = 6f5acc546a7e9ad502d5fe586a3c3072
md5sum = 34f7ab6fe20f685d7d03f2e36f3be207
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
......
......@@ -105,23 +105,22 @@ path-nginx = {{ parameter_list['nginx_location'] }}/sbin/nginx
docroot = ${basedirectory:data}/${slap-configuration:configuration.site}/public
[hugo-server]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/hugo-server
mode = 0700
template =
inline:#!/bin/sh
recipe = slapos.recipe.template
output = ${directory:bin}/hugo-server
inline =
#!/bin/sh
. ${hugo:go-environment}
cd ${basedirectory:data}/${slap-configuration:configuration.site}
if [ -d "public" ]; then rm -Rf public; fi
export TMPDIR=${hugo:path-tmp}
hugo && hugo server --bind=${hugo:ip} --port=${hugo:hugo-port} --baseURL=${hugo-frontend:connection-secure_access} --appendPort=false
hugo && hugo server --bind=${hugo:ip} --port=${hugo:hugo-port} --baseURL=${hugo-frontend:connection-secure_access} --appendPort=false
[hugo-server-service]
recipe = slapos.cookbook:wrapper
wrapper-path = ${basedirectory:service}/hugo-server
command-line = ${hugo-server:rendered}
command-line = ${hugo-server:output}
hash-files =
${hugo-server:rendered}
${hugo-server:output}
[hugo-port-listening-promise]
<= monitor-promise-base
......@@ -152,17 +151,17 @@ config-url = ${:url}
[nginx-conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_nginx_conf'] }}
rendered = ${hugo:path-nginx-conf}
url = {{ parameter_list['template_nginx_conf'] }}
output = ${hugo:path-nginx-conf}
context =
section param_hugo hugo
section param_tempdir tempdirectory
section param_nginxcert nginx-certificate
[mime-types]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_mime_types'] }}
rendered = ${hugo:path-mime-types}
recipe = slapos.recipe.template
url = {{ parameter_list['template_mime_types'] }}
output = ${hugo:path-mime-types}
[nginx-launcher]
recipe = slapos.cookbook:wrapper
......@@ -188,27 +187,25 @@ stop-on-error = true
[default-index-html]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_index_html'] }}
rendered = ${basedirectory:default-public}/index.html
url = {{ parameter_list['template_index_html'] }}
output = ${basedirectory:default-public}/index.html
context =
key go_environment hugo:go-environment
key data basedirectory:data
[default-config-toml]
recipe = slapos.recipe.template:jinja2
rendered = ${basedirectory:default-site}/config.toml
template =
inline:
recipe = slapos.recipe.template
output = ${basedirectory:default-site}/config.toml
inline =
baseURL = "${hugo-frontend:connection-secure_access}"
languageCode = "en-us"
title = "My New Hugo Site"
[nginx-graceful]
recipe = slapos.recipe.template:jinja2
rendered = ${basedirectory:script}/nginx-graceful
mode = 0700
template =
inline:#!/bin/sh
recipe = slapos.recipe.template
output = ${basedirectory:script}/nginx-graceful
inline =
#!/bin/sh
exec kill -s SIGHUP $(cat ${hugo:path-pid})
[nginx-port-listening-promise]
......
......@@ -23,12 +23,12 @@ openssl_location = ${openssl:location}
template_nginx_conf = ${template_nginx_conf:target}
template_mime_types = ${template_mime_types:target}
template_index_html = ${template_index_html:target}
template_monitor = ${monitor-template:rendered}
template_monitor = ${monitor-template:output}
[template-cfg]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
url = ${:_profile_base_location_}/${:filename}
context =
section buildout buildout
section parameter_list profile-common
......
......@@ -15,11 +15,11 @@
[instance]
filename = instance.cfg.in
md5sum = 6c17361a49cfc47564063b867aab6e8c
md5sum = 7333d1dfd4e8e4c375f7f1748292f554
[template-jscrawler]
filename = instance-jscrawler.cfg.jinja2.in
md5sum = 33bfddbc23fa794ab97770ef7776b390
md5sum = ae9269ab5b1cce77016f822024d2d996
[template-jscrawler-builder]
filename = template-jscrawler.builder.sh.in
......
......@@ -67,15 +67,14 @@ config-port = ${httpd-wrapper:port}
[jscrawler-wrapper]
recipe = slapos.cookbook:wrapper
command-line =
{{ parameter_dict['nodejs-location'] }} {{ parameter_dict['jscrawler-location'] }}
{{ parameter_dict['nodejs-location'] }} {{ parameter_dict['jscrawler-location'] }}
wrapper-path = ${directory:bin}/jscrawler
[jscrawler-build-wrapper]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-jscrawler'] }}
rendered = ${directory:bin}/jscrawler-build
url = {{ parameter_dict['template-jscrawler'] }}
output = ${directory:bin}/jscrawler-build
extensions = jinja2.ext.do
mode = 0700
list = {{ slapparameter_dict.get('urls', "").split("\n") | join('\n ') }}
period = {{ slapparameter_dict.get('crawl-periodicity', 0) }}
context =
......@@ -92,7 +91,7 @@ context =
recipe = slapos.cookbook:cron.d
name = jscrawler-build
frequency = * * * * *
command = ${jscrawler-build-wrapper:rendered}
command = ${jscrawler-build-wrapper:output}
[publish-connection-information]
......
......@@ -9,7 +9,7 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-template-jscrawler:rendered
default = dynamic-template-jscrawler:output
RootSoftwareInstance = ${:default}
[slap-configuration]
......@@ -22,9 +22,8 @@ cert = ${slap-connection:cert-file}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
output = ${buildout:directory}/${:filename}
extensions = jinja2.ext.do
mode = 0644
extra-context =
context =
key develop_eggs_directory buildout:develop-eggs-directory
......@@ -49,7 +48,7 @@ template-jscrawler = {{ template_jscrawler_builder }}
[dynamic-template-jscrawler]
<= jinja2-template-base
template = {{ template_jscrawler }}
url = {{ template_jscrawler }}
filename = instance-jscrawler.cfg
extra-context =
section parameter_dict dynamic-template-jscrawler-parameters
......@@ -39,16 +39,16 @@ url = ${:_profile_base_location_}/${:filename}
[instance]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/instance.cfg
template = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
context =
key bash_location bash:location
key bin_directory buildout:bin-directory
key buildout_egg_directory buildout:eggs-directory
key buildout_develop_directory buildout:develop-eggs-directory
key buildout_directory buildout:directory
key template_monitor_cfg monitor2-template:rendered
key logrotate_cfg template-logrotate-base:rendered
key template_monitor_cfg monitor2-template:output
key logrotate_cfg template-logrotate-base:output
key jscrawler_location jscrawler:location
key nodejs_location nodejs:location
key openssl_location openssl:location
......
......@@ -15,7 +15,7 @@
[instance]
filename = instance.cfg.in
md5sum = 342fcf3fc18e33fa4f940518dab6af5c
md5sum = 84380fe6c268301a1e1f501e53943f58
[template-nginx-service]
filename = template-nginx-service.sh.in
......@@ -27,4 +27,4 @@ md5sum = 98faa5ad8cfb23a11d97a459078a1d05
[template-runTestSuite]
filename = runTestSuite.in
md5sum = 9d82f8afa0de8ec2b9c4f32e058fb2bc
md5sum = 70d10e7005b98620ddbbf30030b08198
......@@ -32,8 +32,8 @@ fontconfig-cache = $${buildout:directory}/.fontconfig
[fontconfig-conf]
recipe = slapos.recipe.template:jinja2
template = ${template-fonts-conf:output}
rendered = $${directory:etc}/fonts.conf
url = ${template-fonts-conf:output}
output = $${directory:etc}/fonts.conf
context =
key cachedir directory:fontconfig-cache
key fonts :fonts
......@@ -52,12 +52,11 @@ recipe = slapos.recipe.template
url = ${template-runTestSuite:output}
output = $${directory:bin}/runTestSuite
buildout-directory = $${buildout:directory}
mode = 0700
[runTestSuite-config-file]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/$${:_buildout_section_name_}.json
template = inline:
recipe = slapos.recipe.template
output = $${directory:etc}/$${:_buildout_section_name_}.json
inline =
$${instance-parameter:configuration._}
#################################
......@@ -91,7 +90,6 @@ command-line = bash -c "[ -S $${xvfb-instance:lock-dir}/.X11-unix/X$${xvfb-insta
recipe = slapos.recipe.template
url = ${template-nginx-service:output}
output = $${directory:services}/nginx
mode = 0700
virtual-depends =
$${nginx-configuration:ip}
......@@ -99,7 +97,6 @@ virtual-depends =
recipe = slapos.recipe.template
url = ${template-nginx-configuration:output}
output = $${directory:etc}/nginx.cfg
mode = 0600
access_log = $${directory:log}/nginx-access.log
error_log = $${directory:log}/nginx-error.log
ip = $${instance-parameter:ipv6-random}
......
......@@ -20,14 +20,14 @@ import json
os.environ['XORG_LOCK_DIR'] = '$${xvfb-instance:lock-dir}'
os.environ['DISPLAY'] = '$${xvfb-instance:display}'
os.environ['FONTCONFIG_FILE'] = '$${fontconfig-conf:rendered}'
os.environ['FONTCONFIG_FILE'] = '$${fontconfig-conf:output}'
BASE_URL = 'http://[$${nginx-configuration:ip}]:$${nginx-configuration:port}/'
ETC_DIRECTORY = '$${directory:etc}'
def main():
parsed_parameters = json.load(
open('$${runTestSuite-config-file:rendered}', 'rb'))
open('$${runTestSuite-config-file:output}', 'rb'))
test_runner = parsed_parameters.get('test-runner', {})
parser = argparse.ArgumentParser(description='Run a test suite.')
......
......@@ -110,7 +110,6 @@ update-command = ${:command}
[macro-template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
mode = 0644
[instance]
<= macro-template
......
......@@ -15,11 +15,11 @@
[instance]
filename = instance.cfg.in
md5sum = de37ec3d4adb0be4c67bcc7397f27c91
md5sum = 5f39952f94095b1f12f41db76867e71e
[instance-jupyter]
filename = instance-jupyter.cfg.in
md5sum = 1136bb108aa8d703e0ecf2005b4a1f28
md5sum = ee2fbb01b4143c19fa16f8449ca4ec29
[jupyter-notebook-config]
filename = jupyter_notebook_config.py.jinja
......
......@@ -95,8 +95,8 @@ bytes = 10
[jupyter-notebook-config]
recipe = slapos.recipe.template:jinja2
template = {{ jupyter_config_location }}/{{ jupyter_config_filename }}
rendered = ${directory:jupyter_config_dir}/jupyter_notebook_config.py
url = {{ jupyter_config_location }}/{{ jupyter_config_filename }}
output = ${directory:jupyter_config_dir}/jupyter_notebook_config.py
context =
key password jupyter-password:passwd
raw gcc_location {{ gcc_location }}
......@@ -188,8 +188,8 @@ target-directory = ${directory:erp5_kernel_dir}
[kernel-json]
recipe = slapos.recipe.template:jinja2
template = {{ kernel_json_location }}/{{ kernel_json_filename }}
rendered = ${directory:erp5_kernel_dir}/kernel.json
url = {{ kernel_json_location }}/{{ kernel_json_filename }}
output = ${directory:erp5_kernel_dir}/kernel.json
# Use python2.7 executable bin file for kernel config
context =
raw python_executable {{ python_executable }}
......
......@@ -8,7 +8,7 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
[switch_softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = $${:jupyter}
jupyter = instance-jupyter:rendered
jupyter = instance-jupyter:output
RootSoftwareInstance = $${:default}
[slap-configuration]
......@@ -22,9 +22,8 @@ cert = $${slap-connection:cert-file}
[instance-jupyter]
recipe = slapos.recipe.template:jinja2
filename = instance-jupyter.cfg.in
template = ${instance-jupyter:location}/$${:filename}
rendered = $${buildout:directory}/template.cfg
mode = 0644
url = ${instance-jupyter:location}/$${:filename}
output = $${buildout:directory}/template.cfg
context =
key slapparameter_dict slap-configuration:configuration
raw bin_directory ${buildout:bin-directory}
......
[buildout]
extends =
extends =
buildout.hash.cfg
../../stack/slapos.cfg
../../component/cythonplus/buildout.cfg
......@@ -42,7 +42,6 @@ url = ${:_profile_base_location_}/${:filename}
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 0644
[instance-jupyter]
<= download-file-base
......
......@@ -15,15 +15,15 @@
[template]
filename = instance.cfg.in
md5sum = 087f226ba90928dcc5a722d7008c867a
md5sum = 7e90da1f6dac4233e1aa3248f48e357c
[template-kvm]
filename = instance-kvm.cfg.jinja2
md5sum = 2ff55931eab48f7992e8e1cb16b44b95
md5sum = fb8f9a962cc1c0d986305c6a6ce59082
[template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in
md5sum = 67901b7a97b324aa36851d8e8b43cad6
md5sum = 8562882ac4a888d18db50e2a22e3ca86
[template-kvm-resilient]
filename = instance-kvm-resilient.cfg.jinja2
......@@ -31,7 +31,7 @@ md5sum = a0fd4911401cbbda74323e8d1c7b18ad
[template-kvm-import]
filename = instance-kvm-import.cfg.jinja2.in
md5sum = 0415353c961ece593dd5d6457dab5200
md5sum = a463a5e3cd2287d275d6943c2a11b7e4
[template-kvm-import-script]
filename = template/kvm-import.sh.jinja2
......@@ -39,7 +39,7 @@ md5sum = cd0008f1689dfca9b77370bc4d275b70
[template-kvm-export]
filename = instance-kvm-export.cfg.jinja2
md5sum = 09252c282ef86f4bb3a88e91869b0f97
md5sum = 34d1b7cc8ca62bfdfce759a1dfbbaccd
[template-kvm-export-script]
filename = template/kvm-export.sh.jinja2
......@@ -47,7 +47,7 @@ md5sum = 64aa1ce8785f6b94aabd787fa3443082
[template-nbd]
filename = instance-nbd.cfg.jinja2
md5sum = 4bcb07c1a9223e2d956651aa25d23654
md5sum = e041e8011ad2ec7f104be173ef76f5e9
[template-ansible-promise]
filename = template/ansible-promise.in
......@@ -75,7 +75,7 @@ md5sum = fb330a796fadb6cd5c85217f80a42af3
[template-httpd]
filename = instance-kvm-http.cfg.in
md5sum = d57764bb7135037b4d21543b2f56ce1d
md5sum = 438192aab9f11e40dc521b46a4854dcf
[image-download-controller]
filename = template/image-download-controller.py
......
......@@ -50,7 +50,7 @@ config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}
software-type = kvm
name = {{ instance_name }}
{% if kvm_parameter_dict.get('sticky-computer', '') -%}
sla-computer_guid = ${slap-connection:computer-id}
sla-computer_guid = ${slap-connection:computer-id}
{% else -%}
sla-computer_guid = {{ dumps(kvm_parameter_dict.get('computer-guid', '')) }}
{% endif -%}
......@@ -159,7 +159,7 @@ sla-fw_authorized_sources = {{ authorized_source_list | join(' ') }}
sla-fw_rejected_sources = {{ rejected_source_list | join(' ') }}
sla-fw_restricted_access = {{ dumps(slapparameter_dict.get('fw-restricted-access', 'off')) }}
return =
return =
url
{% if frontend_dict.get('frontend-additional-instance-guid') %}
url-additional
......@@ -231,7 +231,7 @@ config-type = {{ dumps(frontend_parameter_dict['type']) }}
config-path = {{ dumps(frontend_parameter_dict['path']) }}
{% endif -%}
{% endif -%}
return =
return =
site_url
sla-instance_guid = {{ slave_frontend_iguid }}
{% do publish_dict.__setitem__(name ~ '-url', '${' ~ section ~ ':connection-site_url}') -%}
......@@ -272,9 +272,9 @@ port = 9002
{% do part_list.append('write-vm-hostname') -%}
[write-vm-hostname]
recipe = slapos.recipe.template:jinja2
template = {{ template_content }}
url = {{ template_content }}
filename = hosts
rendered = ${directory:webroot}/${hash-code:passwd}/${:filename}
output = ${directory:webroot}/${hash-code:passwd}/${:filename}
context =
raw content_list {{ kvm_hostname_list | join('#') }}
raw sep #
......@@ -313,7 +313,7 @@ password = ${publish-early:monitor-password}
{% endfor %}
[monitor-conf-parameters]
private-path-list +=
private-path-list +=
${directory:webroot}/
[publish-connection-information]
......@@ -326,11 +326,11 @@ recipe = slapos.cookbook:publish
{% do part_list.append('monitor-base') -%}
[buildout]
extends =
extends =
{{ template_httpd_cfg }}
{{ ' ' ~ template_monitor }}
parts =
parts =
httpd
httpd-graceful
httpd-promise
......@@ -339,7 +339,7 @@ parts =
# Complete parts with sections
{{ part_list | join('\n ') }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
......@@ -19,11 +19,10 @@ parts +=
# Create the exporter executable, which is a simple shell script
[exporter]
recipe = slapos.recipe.template:jinja2
template = {{ template_kvm_export }}
rendered = ${directory:bin}/${slap-parameter:namebase}-exporter
url = {{ template_kvm_export }}
output = ${directory:bin}/${slap-parameter:namebase}-exporter
# Resilient stack wants a "wrapper" parameter
wrapper = ${:rendered}
mode = 0700
wrapper = ${:output}
{%- set disk_type = slapparameter_dict.get('disk-type', 'virtio') %}
{%- if disk_type == "virtio" %}
device = virtio0
......
[buildout]
parts =
parts =
httpd
httpd-graceful
httpd-promise
......@@ -20,8 +20,8 @@ ssl = ${:etc}/ssl
[apache-conf]
recipe = slapos.recipe.template:jinja2
template = {{ template_apache_conf }}
rendered = ${directory:etc}/apache.conf
url = {{ template_apache_conf }}
output = ${directory:etc}/apache.conf
ip = ${slap-network-information:global-ipv6}
#ipv4 = ${slap-network-information:local-ipv4}
port = ${slap-parameter:httpd-port}
......@@ -31,7 +31,7 @@ pid-file = ${directory:run}/apache.pid
index = ${directory:public}
root = {:index}
denied-root-access = false
context =
context =
key port :port
key ip :ip
key access_log :access-log
......@@ -45,7 +45,7 @@ context =
[httpd]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/httpd
command-line = "{{ apache_location }}/bin/httpd" -f "${apache-conf:rendered}" -DFOREGROUND
command-line = "{{ apache_location }}/bin/httpd" -f "${apache-conf:output}" -DFOREGROUND
[httpd-graceful]
recipe = collective.recipe.template
......@@ -60,7 +60,7 @@ recipe = plone.recipe.command
command = "{{ openssl_executable_location }}" req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout "${:key}" -out "${:cert}"
key = ${directory:ssl}/key
cert = ${directory:ssl}/cert
update-command =
update-command =
stop-on-error = true
[httpd-promise]
......
......@@ -4,12 +4,12 @@ eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
parts +=
parts +=
kvm-disk-image-corruption-promise
# Here, we don't need KVM to run to import data, so we don't
# even extend the kvm instance profile.
extends =
extends =
{{ pbsready_import_template }}
[slap-parameter]
......@@ -59,11 +59,10 @@ cronstamps = ${:etc}/cronstamps
[importer]
recipe = slapos.recipe.template:jinja2
template = {{ template_kvm_import }}
rendered = ${directory:bin}/${slap-parameter:namebase}-importer
mode = 0700
url = {{ template_kvm_import }}
output = ${directory:bin}/${slap-parameter:namebase}-importer
# Resilient stack wants a "wrapper" parameter
wrapper = ${:rendered}
wrapper = ${:output}
context =
section directory directory
raw zcat_binary {{ zcat_binary }}
......
......@@ -99,14 +99,14 @@ config-url = ${monitor-base:base-url}/private/boot-image-url-select/${:filename}
[boot-image-url-select-source-config]
recipe = slapos.recipe.template:jinja2
template = inline:
inline =
{%- raw %}
{{ boot_image_url_select }}
{% endraw -%}
boot-image-url-select = {{ dumps(slapparameter_dict['boot-image-url-select']) }}
context =
key boot_image_url_select :boot-image-url-select
rendered = ${directory:etc}/boot-image-url-select.json
output = ${directory:etc}/boot-image-url-select.json
[boot-image-url-select-processed-config]
# compares if the current configuration has been used by
......@@ -131,7 +131,7 @@ install =
state_handler.write(str(e))
update = ${:install}
config-file = ${boot-image-url-select-source-config:rendered}
config-file = ${boot-image-url-select-source-config:output}
state-filename = boot-image-url-select-processed-config.state
state-file = ${directory:boot-image-url-select-expose}/${:state-filename}
processed-md5sum = ${directory:boot-image-url-select-var}/update-image-processed.md5sum
......@@ -146,9 +146,9 @@ config-filename = ${boot-image-url-select-processed-config:state-file}
[boot-image-url-select-json-config]
# generates json configuration from user configuration
recipe = plone.recipe.command
command = {{ python_executable }} {{ image_download_config_creator }} ${boot-image-url-select-source-config:rendered} ${:rendered} ${directory:boot-image-url-select-repository} ${:error-state-file}
command = {{ python_executable }} {{ image_download_config_creator }} ${boot-image-url-select-source-config:output} ${:output} ${directory:boot-image-url-select-repository} ${:error-state-file}
update-command = ${:command}
rendered = ${directory:boot-image-url-select-var}/boot-image-url-select.json
output = ${directory:boot-image-url-select-var}/boot-image-url-select.json
error-state-filename = boot-image-url-select-json-config-error.txt
error-state-file = ${directory:boot-image-url-select-expose}/${:error-state-filename}
......@@ -163,7 +163,7 @@ config-filename = ${boot-image-url-select-json-config:error-state-file}
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:scripts}/boot-image-url-select-updater
command-line = {{ python_executable }} {{ image_download_controller }} ${:config} {{ curl_executable_location }} ${:md5sum-state-file} ${:error-state-file} ${boot-image-url-select-processed-config:processed-md5sum}
config = ${boot-image-url-select-json-config:rendered}
config = ${boot-image-url-select-json-config:output}
md5sum-state-filename = boot-image-url-select-download-controller-md5sum-fail.json
md5sum-state-file = ${directory:boot-image-url-select-expose}/${:md5sum-state-filename}
error-state-filename = boot-image-url-select-download-controller-error.text
......@@ -196,14 +196,14 @@ config-url = ${monitor-base:base-url}/private/boot-image-url-list/${:filename}
[boot-image-url-list-source-config]
recipe = slapos.recipe.template:jinja2
template = inline:
inline =
{%- raw %}
{{ boot_image_url_list }}
{% endraw -%}
boot-image-url-list = {{ dumps(slapparameter_dict['boot-image-url-list']) }}
context =
key boot_image_url_list :boot-image-url-list
rendered = ${directory:etc}/boot-image-url-list.conf
output = ${directory:etc}/boot-image-url-list.conf
[boot-image-url-list-processed-config]
# compares if the current configuration has been used by
......@@ -228,7 +228,7 @@ install =
state_handler.write(str(e))
update = ${:install}
config-file = ${boot-image-url-list-source-config:rendered}
config-file = ${boot-image-url-list-source-config:output}
state-filename = boot-image-url-list-processed-config.state
state-file = ${directory:boot-image-url-list-expose}/${:state-filename}
processed-md5sum = ${directory:boot-image-url-list-var}/update-image-processed.md5sum
......@@ -243,9 +243,9 @@ config-filename = ${boot-image-url-list-processed-config:state-file}
[boot-image-url-list-json-config]
# generates json configuration from user configuration
recipe = plone.recipe.command
command = {{ python_executable }} {{ image_download_config_creator }} ${boot-image-url-list-source-config:rendered} ${:rendered} ${directory:boot-image-url-list-repository} ${:error-state-file}
command = {{ python_executable }} {{ image_download_config_creator }} ${boot-image-url-list-source-config:output} ${:output} ${directory:boot-image-url-list-repository} ${:error-state-file}
update-command = ${:command}
rendered = ${directory:boot-image-url-list-var}/boot-image-url-list.json
output = ${directory:boot-image-url-list-var}/boot-image-url-list.json
error-state-filename = boot-image-url-list-json-config-error.txt
error-state-file = ${directory:boot-image-url-list-expose}/${:error-state-filename}
......@@ -260,7 +260,7 @@ config-filename = ${boot-image-url-list-json-config:error-state-file}
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:scripts}/boot-image-url-list-updater
command-line = {{ python_executable }} {{ image_download_controller }} ${:config} {{ curl_executable_location }} ${:md5sum-state-file} ${:error-state-file} ${boot-image-url-list-processed-config:processed-md5sum}
config = ${boot-image-url-list-json-config:rendered}
config = ${boot-image-url-list-json-config:output}
md5sum-state-filename = boot-image-url-list-download-controller-md5sum-fail.json
md5sum-state-file = ${directory:boot-image-url-list-expose}/${:md5sum-state-filename}
error-state-filename = boot-image-url-list-download-controller-error.text
......@@ -293,7 +293,7 @@ config-url = ${monitor-base:base-url}/private/virtual-hard-drive-url/${:filename
[virtual-hard-drive-url-source-config]
recipe = slapos.recipe.template:jinja2
template = inline:
inline =
{%- raw %}
{{ virtual_hard_drive_url }}
{% endraw -%}
......@@ -301,7 +301,7 @@ template = inline:
virtual-hard-drive-url = {{ slapparameter_dict['virtual-hard-drive-url'] }}#{{ slapparameter_dict['virtual-hard-drive-md5sum'] }}
context =
key virtual_hard_drive_url :virtual-hard-drive-url
rendered = ${directory:etc}/virtual-hard-drive-url.conf
output = ${directory:etc}/virtual-hard-drive-url.conf
[virtual-hard-drive-url-processed-config]
# compares if the current configuration has been used by
......@@ -326,7 +326,7 @@ install =
state_handler.write(str(e))
update = ${:install}
config-file = ${virtual-hard-drive-url-source-config:rendered}
config-file = ${virtual-hard-drive-url-source-config:output}
state-filename = virtual-hard-drive-url-processed-config.state
state-file = ${directory:virtual-hard-drive-url-expose}/${:state-filename}
processed-md5sum = ${directory:virtual-hard-drive-url-var}/update-image-processed.md5sum
......@@ -341,9 +341,9 @@ config-filename = ${virtual-hard-drive-url-processed-config:state-file}
[virtual-hard-drive-url-json-config]
# generates json configuration from user configuration
recipe = plone.recipe.command
command = {{ python_executable }} {{ image_download_config_creator }} ${virtual-hard-drive-url-source-config:rendered} ${:rendered} ${directory:virtual-hard-drive-url-repository} ${:error-state-file}
command = {{ python_executable }} {{ image_download_config_creator }} ${virtual-hard-drive-url-source-config:output} ${:output} ${directory:virtual-hard-drive-url-repository} ${:error-state-file}
update-command = ${:command}
rendered = ${directory:virtual-hard-drive-url-var}/virtual-hard-drive-url.json
output = ${directory:virtual-hard-drive-url-var}/virtual-hard-drive-url.json
error-state-filename = virtual-hard-drive-url-json-config-error.txt
error-state-file = ${directory:virtual-hard-drive-url-expose}/${:error-state-filename}
......@@ -358,7 +358,7 @@ config-filename = ${virtual-hard-drive-url-json-config:error-state-file}
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:scripts}/virtual-hard-drive-url-updater
command-line = {{ python_executable }} {{ image_download_controller }} ${:config} {{ curl_executable_location }} ${:md5sum-state-file} ${:error-state-file} ${virtual-hard-drive-url-processed-config:processed-md5sum}
config = ${virtual-hard-drive-url-json-config:rendered}
config = ${virtual-hard-drive-url-json-config:output}
md5sum-state-filename = virtual-hard-drive-url-download-controller-md5sum-fail.json
md5sum-state-file = ${directory:virtual-hard-drive-url-expose}/${:md5sum-state-filename}
error-state-filename = virtual-hard-drive-url-download-controller-error.text
......@@ -401,17 +401,17 @@ vnc-port = 5901
default-cdrom-iso = {{ debian_amd64_netinst_location }}
{% if virtual_hard_drive_url_enabled %}
virtual-hard-drive-url-json-config = ${virtual-hard-drive-url-json-config:rendered}
virtual-hard-drive-url-json-config = ${virtual-hard-drive-url-json-config:output}
{% else %}
virtual-hard-drive-url-json-config =
{% endif %}
{% if boot_image_url_list_enabled %}
boot-image-url-list-json-config = ${boot-image-url-list-json-config:rendered}
boot-image-url-list-json-config = ${boot-image-url-list-json-config:output}
{% else %}
boot-image-url-list-json-config =
{% endif %}
{% if boot_image_url_select_enabled %}
boot-image-url-select-json-config = ${boot-image-url-select-json-config:rendered}
boot-image-url-select-json-config = ${boot-image-url-select-json-config:output}
{% else %}
boot-image-url-select-json-config =
{% endif %}
......@@ -499,17 +499,15 @@ log-file = ${directory:log}/qemu.log
[kvm-run]
recipe = slapos.recipe.template:jinja2
template = {{ template_kvm_run }}
rendered = ${directory:bin}/kvm_raw
mode = 700
url = {{ template_kvm_run }}
output = ${directory:bin}/kvm_raw
context =
section parameter_dict kvm-parameter-dict
[kvm-controller]
recipe = slapos.recipe.template:jinja2
template = {{ template_kvm_controller_run }}
rendered = ${directory:bin}/kvm_controller_raw
mode = 700
url = {{ template_kvm_controller_run }}
output = ${directory:bin}/kvm_controller_raw
context =
section parameter_dict kvm-controller-parameter-dict
......@@ -539,7 +537,7 @@ ipv6-port = {{ external_port }}
{% endif -%}
{%- set depend_section_list = [] %}
{%- set hash_file_list = ['${kvm-run:rendered}'] %}
{%- set hash_file_list = ['${kvm-run:output}'] %}
{%- macro generate_depend_section(section, key) %}
{%- do depend_section_list.append('${' + section + ':command}' ) %}
{%- do hash_file_list.append('${' + key + '}') %}
......@@ -567,7 +565,7 @@ depends =
recipe = slapos.cookbook:wrapper
socket-path = ${kvm-controller-parameter-dict:socket-path}
wrapper-path = ${directory:services}/kvm
command-line = ${kvm-run:rendered}
command-line = ${kvm-run:output}
kvm-controller = ${kvm-controller-wrapper:wrapper-path}
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
hash-files =
......@@ -578,7 +576,7 @@ hash-files =
[kvm-controller-wrapper]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:scripts}/kvm_controller
command-line = ${kvm-controller:rendered}
command-line = ${kvm-controller:output}
[kvm-vnc-promise]
......@@ -630,9 +628,8 @@ command-line =
[kvm-started-bin]
recipe = slapos.recipe.template:jinja2
template = {{ qemu_start_promise_tpl }}
rendered = ${directory:bin}/qemu-virtual-machine-is-ready
mode = 700
url = {{ qemu_start_promise_tpl }}
output = ${directory:bin}/qemu-virtual-machine-is-ready
context =
raw dash {{ dash_executable_location }}
raw qemu_ready_path ${kvm-controller-parameter-dict:kvm-status-path}
......@@ -642,7 +639,7 @@ context =
<= monitor-promise-base
promise = check_command_execute
name = qemu-virtual-machine-is-ready.py
config-command = ${kvm-started-bin:rendered}
config-command = ${kvm-started-bin:output}
[novnc-instance]
recipe = slapos.cookbook:novnc
......@@ -943,7 +940,7 @@ mode = {{ mode }}
{% endmacro -%}
# write vm-data into file public/data
{{ writefile('vm-data-content', '${directory:public}/data', slapparameter_dict.get('data-to-vm', ''), '700') }}
{{ writefile('vm-data-content', '${directory:public}/data', slapparameter_dict.get('data-to-vm', '')) }}
{% if slapparameter_dict.get('authorized-key', '') -%}
# write public key for vms to public/authorized_keys
......@@ -991,9 +988,9 @@ update-command = ${:command}
# To access documents of main instance (in case of kvm-cluster) through http
[cluster-url-path]
recipe = slapos.recipe.template:jinja2
template = {{ template_content }}
url = {{ template_content }}
filename = cluster.hash
rendered = ${directory:public}/${:filename}
output = ${directory:public}/${:filename}
hash-url = https://10.0.2.101:443/{{ slapparameter_dict.get('document-path', '') }}
context =
key content_list :hash-url
......@@ -1018,8 +1015,8 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
[ansible-vm-bin]
recipe = slapos.recipe.template:jinja2
template = {{ ansible_promise_tpl }}
rendered = ${directory:bin}/ansible_{{ name }}
url = {{ ansible_promise_tpl }}
output = ${directory:bin}/ansible_{{ name }}
extensions = jinja2.ext.do
context =
raw logs ${directory:public}/ansible
......@@ -1029,7 +1026,7 @@ context =
<= monitor-promise-base
promise = check_command_execute
name = ansible_{{ name }}.py
config-command = ${ansible-vm-bin:rendered}
config-command = ${ansible-vm-bin:output}
{% if bootstrap_script_url -%}
[download-bootstrap-script]
......@@ -1152,7 +1149,7 @@ data-to-vm =
{% do part_list.append('disk-device-permission') -%}
[disk-device-permission]
recipe = slapos.recipe.template:jinja2
template = inline:
inline =
{%- raw %}
{%- set disk_list = [] %}
{%- for disk in disk_device_path.split() %}
......@@ -1160,7 +1157,7 @@ template = inline:
{%- endfor -%}
{{ json_module.dumps(disk_list) }}
{% endraw -%}
rendered = ${buildout:directory}/.slapos-disk-permission
output = ${buildout:directory}/.slapos-disk-permission
extensions = jinja2.ext.do
context =
import json_module json
......@@ -1168,14 +1165,13 @@ context =
{% do part_list.append('wipe-disk-device-wrapper') -%}
[wipe-disk-device-wrapper]
recipe = slapos.recipe.template:jinja2
template = inline:
recipe = slapos.recipe.template
inline =
#!/bin/sh
{%- for disk_device in disk_device_path.split() %}
dd if=/dev/zero of={{ disk_device }} bs=4096 count=500k
{%- endfor %}
rendered = ${directory:prerm}/slapos_wipe_device_disk
mode = 0700
output = ${directory:prerm}/slapos_wipe_device_disk
{% endif -%}
{% do part_list.append('whitelist-firewall') -%}
......@@ -1190,7 +1186,7 @@ command-line =
${:source}
source =
${whitelist-domains-request:rendered}
${whitelist-domains-request:output}
{{ whitelist_domains_default }}
${whitelist-domains-resolv.conf:output}
${whitelist-domains-download:output}
......@@ -1204,13 +1200,13 @@ update-command = ${:command}
[whitelist-domains-request]
recipe = slapos.recipe.template:jinja2
template = inline:
inline =
{%- raw %}
{%- for domain in whitelist_domains.split() %}
{{ domain }}
{%- endfor %}
{% endraw -%}
rendered = ${whitelist-firewall-directory:location}/${:_buildout_section_name_}.txt
output = ${whitelist-firewall-directory:location}/${:_buildout_section_name_}.txt
whitelist-domains = {{ dumps(whitelist_domains) }}
extensions = jinja2.ext.do
context =
......
......@@ -35,17 +35,18 @@ shell-path = {{ dash_executable_location }}
path = ${basedirectory:services}/nbdserver
[nbd-checker-bin]
recipe = slapos.recipe.template:jinja2
template = inline:#!/bin/sh
recipe = slapos.recipe.template
inline =
#!/bin/sh
[ ! -f ${onetimeupload-instance:image-path} ] ||
${buildout:executable} -c 'import socket ; socket.create_connection(("${nbd-instance:ip}","${nbd-instance:port}")).close()'
rendered = ${rootdirectory:bin}/check-nbd-running.sh
output = ${rootdirectory:bin}/check-nbd-running.sh
[nbd-promise]
<= monitor-promise-base
promise = check_command_execute
name = nbd_promise.py
config-command = ${nbd-checker-bin:rendered}
config-command = ${nbd-checker-bin:output}
[gen-passwd]
recipe = slapos.cookbook:generate.password
......
......@@ -10,16 +10,16 @@ extends = ${template-resilient-templates:output}
[switch_softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = $${:kvm}
kvm-cluster = dynamic-template-kvm-cluster:rendered
kvm = dynamic-template-kvm:rendered
nbd = dynamic-template-nbd:rendered
kvm-cluster = dynamic-template-kvm-cluster:output
kvm = dynamic-template-kvm:output
nbd = dynamic-template-nbd:output
kvm-resilient = dynamic-template-kvm-resilient:rendered
kvm-import = dynamic-template-kvm-import:rendered
kvm-export = dynamic-template-kvm-export:rendered
kvm-resilient = dynamic-template-kvm-resilient:output
kvm-import = dynamic-template-kvm-import:output
kvm-export = dynamic-template-kvm-export:output
frozen = instance-frozen:rendered
pull-backup = template-pull-backup:rendered
frozen = instance-frozen:output
pull-backup = template-pull-backup:output
# BBB
RootSoftwareInstance = $${:default}
......@@ -42,9 +42,8 @@ storage-home = $${storage-configuration:storage-home}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/$${:filename}
output = $${buildout:directory}/$${:filename}
extensions = jinja2.ext.do
mode = 0644
extra-context =
context =
key develop_eggs_directory buildout:develop-eggs-directory
......@@ -62,18 +61,18 @@ context =
[dynamic-template-kvm-cluster]
<= jinja2-template-base
template = ${template-kvm-cluster:location}/instance-kvm-cluster.cfg.jinja2.in
url = ${template-kvm-cluster:location}/instance-kvm-cluster.cfg.jinja2.in
filename = template-kvm-cluster.cfg
extra-context =
section parameter_dict dynamic-template-kvm-cluster-parameters
raw logrotate_cfg ${template-logrotate-base:rendered}
raw logrotate_cfg ${template-logrotate-base:output}
raw template_content ${template-content:target}
raw template_httpd_cfg ${template-httpd:rendered}
raw template_monitor ${monitor2-template:rendered}
raw template_httpd_cfg ${template-httpd:output}
raw template_monitor ${monitor2-template:output}
[dynamic-template-kvm]
<= jinja2-template-base
template = ${template-kvm:location}/instance-kvm.cfg.jinja2
url = ${template-kvm:location}/instance-kvm.cfg.jinja2
filename = template-kvm.cfg
extra-context =
section slap_configuration slap-configuration
......@@ -87,7 +86,7 @@ extra-context =
raw whitelist_firewall_download_controller ${whitelist-firewall-download-controller:target}
raw image_download_controller ${image-download-controller:target}
raw image_download_config_creator ${image-download-config-creator:target}
raw logrotate_cfg ${template-logrotate-base:rendered}
raw logrotate_cfg ${template-logrotate-base:output}
raw novnc_location ${noVNC:location}
raw netcat_bin ${netcat:location}/bin/netcat
raw python_executable ${buildout:executable}
......@@ -96,11 +95,11 @@ extra-context =
raw qemu_img_executable_location ${qemu:location}/bin/qemu-img
raw qemu_start_promise_tpl ${template-qemu-ready:target}
raw sixtunnel_executable_location ${6tunnel:location}/bin/6tunnel
raw template_httpd_cfg ${template-httpd:rendered}
raw template_httpd_cfg ${template-httpd:output}
raw template_content ${template-content:target}
raw template_kvm_controller_run ${template-kvm-controller:target}
raw template_kvm_run ${template-kvm-run:target}
raw template_monitor ${monitor2-template:rendered}
raw template_monitor ${monitor2-template:output}
raw websockify_executable_location ${buildout:directory}/bin/websockify
raw wipe_disk_wrapper ${buildout:directory}/bin/securedelete
template-parts-destination = ${template-parts:target}
......@@ -110,55 +109,52 @@ import-list = file parts :template-parts-destination
[dynamic-template-kvm-resilient]
recipe = slapos.recipe.template:jinja2
template = ${template-kvm-resilient:location}/instance-kvm-resilient.cfg.jinja2
rendered = $${buildout:directory}/template-kvm-resilient.cfg
url = ${template-kvm-resilient:location}/instance-kvm-resilient.cfg.jinja2
output = $${buildout:directory}/template-kvm-resilient.cfg
extensions = jinja2.ext.do
context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration
raw curl_executable_location ${curl:location}/bin/curl
raw template_monitor ${monitor2-template:rendered}
raw template_monitor ${monitor2-template:output}
template-parts-destination = ${template-parts:target}
template-replicated-destination = ${template-replicated:target}
import-list = file parts :template-parts-destination
file replicated :template-replicated-destination
mode = 0644
[dynamic-template-kvm-export]
recipe = slapos.recipe.template:jinja2
template = ${template-kvm-export:location}/instance-kvm-export.cfg.jinja2
rendered = $${buildout:directory}/template-kvm-export.cfg
url = ${template-kvm-export:location}/instance-kvm-export.cfg.jinja2
output = $${buildout:directory}/template-kvm-export.cfg
extensions = jinja2.ext.do
context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
raw kvm_template $${dynamic-template-kvm:rendered}
raw kvm_template $${dynamic-template-kvm:output}
raw template_kvm_export ${template-kvm-export-script:target}
key pbsready_export_template template-pbsready-export:rendered
key pbsready_export_template template-pbsready-export:output
raw gzip_binary ${gzip:location}/bin/gzip
key slapparameter_dict slap-configuration:configuration
mode = 0644
[dynamic-template-kvm-import]
recipe = slapos.recipe.template:jinja2
template = ${template-kvm-import:location}/instance-kvm-import.cfg.jinja2.in
rendered = $${buildout:directory}/template-kvm-import.cfg
url = ${template-kvm-import:location}/instance-kvm-import.cfg.jinja2.in
output = $${buildout:directory}/template-kvm-import.cfg
extensions = jinja2.ext.do
context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
raw qemu_location ${qemu:location}
raw template_kvm_import ${template-kvm-import-script:target}
key pbsready_import_template template-pbsready-import:rendered
key pbsready_import_template template-pbsready-import:output
key slapparameter_dict slap-configuration:configuration
raw zcat_binary ${gzip:location}/bin/zcat
raw gzip_binary ${gzip:location}/bin/gzip
mode = 0644
[dynamic-template-nbd]
<= jinja2-template-base
template = ${template-nbd:location}/instance-nbd.cfg.jinja2
url = ${template-nbd:location}/instance-nbd.cfg.jinja2
filename = template-nbd.cfg
context =
section slap_configuration slap-configuration
......@@ -168,4 +164,4 @@ context =
raw qemu_nbd_executable_location ${qemu:location}/bin/qemu-nbd
raw dash_executable_location ${dash:location}/bin/dash
raw onetimeupload_executable_location ${buildout:bin-directory}/onetimeupload
raw template_monitor ${monitor2-template:rendered}
raw template_monitor ${monitor2-template:output}
......@@ -110,8 +110,8 @@ output = ${buildout:directory}/template.cfg
[template-httpd]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-kvm-http.cfg.in
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/instance-kvm-http.cfg
url = ${:_profile_base_location_}/instance-kvm-http.cfg.in
output = ${buildout:parts-directory}/${:_buildout_section_name_}/instance-kvm-http.cfg
context =
key apache_location apache:location
raw openssl_executable_location ${openssl:location}/bin/openssl
......
......@@ -19,7 +19,7 @@ md5sum = 9940e05d5e624a7884f4e6e062355798
[template-matomo-instance]
filename = matomo-instance.cfg.in
md5sum = 34925db56b5f97e5a29080fb83fbefa8
md5sum = 83cc1478a59409a6ef19d6f4fcd7380f
[template-matomo-backup.sh]
filename = matomo-backup.sh.in
......
......@@ -19,26 +19,26 @@ php.max_file_uploads = 100
[php-bin]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/php
command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:rendered}
command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:output}
[matomo-backup-cron]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = matomo-backup
frequency = 0 0 * * *
command = ${matomo-backup.sh:rendered}
command = ${matomo-backup.sh:output}
[matomo-apache-httpd]
recipe = slapos.recipe.template:jinja2
template = {{ matomo_apache_httpd }}
rendered = ${directory:apache.d}/matomo.conf
url = {{ matomo_apache_httpd }}
output = ${directory:apache.d}/matomo.conf
context =
section parameter_dict apache-php-configuration
[matomo-backup.sh]
recipe = slapos.recipe.template:jinja2
template = {{ matomo_backup_sh }}
rendered = ${directory:scripts}/matomo-backup
url = {{ matomo_backup_sh }}
output = ${directory:scripts}/matomo-backup
context =
section parameter_dict instance-parameter
key php_bin php-bin:wrapper-path
......
......@@ -36,13 +36,13 @@ md5sum = 8d592676bc2c0d51363ad7b2caf171fe
# give the location of the instance-matomo.cfg fil
# Without it the instance-matomo.cfg file will not be executed
[custom-application-deployment]
path = ${template-matomo-instance:rendered}
path = ${template-matomo-instance:output}
part-list = matomo-backup.sh matomo-backup-cron matomo-apache-httpd
[template-matomo-instance]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/instance-matomo.cfg
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance-matomo.cfg
extensions = jinja2.ext.do
context =
key findutils_location findutils:location
......
[instance-profile]
filename = instance.cfg.in
md5sum = 5f2f7c4c2f793d609ad3c4fa0aa2f8a5
md5sum = a0a375dcd29a21ef121931f40e5e6d51
......@@ -2,15 +2,15 @@
parts =
publish-connection-parameter
extends = ${monitor2-template:rendered}
extends = ${monitor2-template:output}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[fontconfig-conf]
recipe = slapos.recipe.template:jinja2
template = ${template-fonts-conf:output}
rendered = $${directory:etc}/fonts.conf
url = ${template-fonts-conf:output}
output = $${directory:etc}/fonts.conf
context =
key cachedir directory:fontconfig-cache
key fonts :fonts
......@@ -46,7 +46,7 @@ environment =
MB_DB_USER=$${postgresql:superuser}
MB_DB_PASS=$${postgresql:password}
MB_DB_HOST=$${postgresql:ipv4}
FONTCONFIG_FILE=$${fontconfig-conf:rendered}
FONTCONFIG_FILE=$${fontconfig-conf:output}
JAVA_ARGS=-Dorg.quartz.scheduler.instanceId=$${slap-connection:computer-id}.$${slap-connection:partition-id} -Djava.io.tmpdir="$${directory:tmp}"
hash-existing-files =
$${buildout:directory}/software_release/buildout.cfg
......
......@@ -14,11 +14,11 @@
# not need these here).
[template]
filename = instance.cfg
md5sum = 37966f5f7c6b82137c0388ca3520cb71
md5sum = 0d26da3f83b293efbf330fd2b0350bf6
[template-monitor]
_update_hash_filename_ = instance-monitor.cfg.jinja2
md5sum = f23c007d6d6aed137cfd54aaa7ba52ab
md5sum = 5afba85a7aca9e716f61d59a524adc12
[json-test-template]
_update_hash_filename_ = json-test-template.json.in.jinja2
......@@ -26,15 +26,15 @@ md5sum = 2eb5596544d9c341acf653d4f7ce2680
[template-monitor-edgetest-basic]
_update_hash_filename_ = instance-monitor-edgetest-basic.cfg.jinja2
md5sum = 05c00ac393b50cfdef5d3bc5af93fe98
md5sum = 8e0c4041f680312ff054687d7f28275a
[template-monitor-edgetest]
_update_hash_filename_ = instance-monitor-edgetest.cfg.jinja2
md5sum = 3c8ab4e78f66c974eb95afc595a13514
md5sum = a16fb139d9f3d01a88f499450fac50b4
[template-monitor-edgebot]
_update_hash_filename_ = instance-monitor-edgebot.cfg.jinja2
md5sum = 436bb5251c8f1cd1e64bd5d3987d699c
md5sum = 7b927af12934c228d2763c5a40c634b5
[network-bench-cfg]
filename = network_bench.cfg.in
......
......@@ -59,8 +59,8 @@ config-json-file = ${surykatka-config-{{ class }}:json}
[surykatka-config-{{ class }}]
recipe = slapos.recipe.template:jinja2
db = ${directory:srv}/surykatka-{{ class }}.db
rendered = ${directory:etc}/surykatka-{{ class }}.ini
template = {{ template_surykatka_ini }}
output = ${directory:etc}/surykatka-{{ class }}.ini
url = {{ template_surykatka_ini }}
url_list = {{ dumps(URL_LIST) }}
nameserver_list = {{ dumps(CONFIGURATION['nameserver-list']) }}
json = ${directory:srv}/surykatka-{{ class }}.json
......@@ -76,26 +76,26 @@ context =
[surykatka-{{ class }}]
recipe = slapos.cookbook:wrapper
config = ${surykatka-config-{{ class }}:rendered}
config = ${surykatka-config-{{ class }}:output}
command-line =
{{ surykatka_binary }} --run crawl --reload --configuration ${:config}
wrapper-path = ${monitor-directory:service}/${:_buildout_section_name_}
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
[surykatka-status-json-{{ class }}]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template
json = ${surykatka-config-{{ class }}:json}
template = inline:#!/bin/sh
inline =
#!/bin/sh
{{ surykatka_binary }} --run status --configuration ${surykatka-{{ class }}:config} --output json --stdout ${:json}
rendered = ${monitor-directory:bin}/${:_buildout_section_name_}
mode = 0755
output = ${monitor-directory:bin}/${:_buildout_section_name_}
[cron-entry-surykatka-status-{{ class }}]
recipe = slapos.cookbook:cron.d
cron-entries = ${directory:etc}/cron.d
name = surykatka-status-{{ class }}
frequency = */2 * * * *
command = ${surykatka-status-json-{{ class }}:rendered}
command = ${surykatka-status-json-{{ class }}:output}
{%- do part_list.append('surykatka-%i'% (class,)) %}
{%- do part_list.append('surykatka-bot-promise-%i' % (class,)) %}
{%- do part_list.append('cron-entry-surykatka-status-%i' % (class,)) %}
......
......@@ -83,8 +83,8 @@ config-json-file = ${surykatka-config-{{ class }}:json}
[surykatka-config-{{ class }}]
recipe = slapos.recipe.template:jinja2
db = ${directory:srv}/surykatka-{{ class }}.db
rendered = ${directory:etc}/surykatka-{{ class }}.ini
template = {{ template_surykatka_ini }}
output = ${directory:etc}/surykatka-{{ class }}.ini
url = {{ template_surykatka_ini }}
url_list = {{ dumps(CLASS_URL_LIST) }}
nameserver_list = {{ dumps(DEFAULT_DICT['nameserver-list']) }}
json = ${directory:srv}/surykatka-{{ class }}.json
......@@ -101,7 +101,7 @@ context =
{%- do PART_LIST.append('surykatka-%i'% (class,)) %}
[surykatka-{{ class }}]
recipe = slapos.cookbook:wrapper
config = ${surykatka-config-{{ class }}:rendered}
config = ${surykatka-config-{{ class }}:output}
command-line =
{{ surykatka_binary }} --run crawl --reload --configuration ${:config}
wrapper-path = ${monitor-directory:service}/${:_buildout_section_name_}
......@@ -118,12 +118,12 @@ config-state = not-empty
config-url =
[surykatka-status-json-{{ class }}]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template
json = ${surykatka-config-{{ class }}:json}
template = inline:#!/bin/sh
inline =
#!/bin/sh
{{ surykatka_binary }} --run status --configuration ${surykatka-{{ class }}:config} --output json --stdout ${:json}
rendered = ${monitor-directory:bin}/${:_buildout_section_name_}
mode = 0755
output = ${monitor-directory:bin}/${:_buildout_section_name_}
{%- do PART_LIST.append('cron-entry-surykatka-status-%i' % (class,)) %}
[cron-entry-surykatka-status-{{ class }}]
......@@ -131,7 +131,7 @@ recipe = slapos.cookbook:cron.d
cron-entries = ${directory:etc}/cron.d
name = surykatka-status-{{ class }}
frequency = */2 * * * *
command = ${surykatka-status-json-{{ class }}:rendered}
command = ${surykatka-status-json-{{ class }}:output}
{%- endfor %} {#- for class, class_check_list in CHECK_DICT.items() #}
[buildout]
......
......@@ -2,7 +2,7 @@
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
output = ${buildout:directory}/${:filename}
extra-context =
context =
import json_module json
......@@ -10,7 +10,7 @@ context =
[slave-test-configuration]
<=jinja2-template-base
template = {{ template_json_edgetest_test }}
url = {{ template_json_edgetest_test }}
filename = srv/monitor/private/test.json
extensions = jinja2.ext.do
extra-context =
......
......@@ -25,7 +25,7 @@ recipe = slapos.cookbook:cron.d
name = network-bench-test
frequency = */10 * * * *
# skip to not fill cron log file.
# command = {{ buildout_bin }}/networkbench ${network-bench-configuration:rendered} ${monitor-directory:monitor-log}
# command = {{ buildout_bin }}/networkbench ${network-bench-configuration:output} ${monitor-directory:monitor-log}
command = true
......@@ -41,9 +41,8 @@ autocreate = true
[network-bench-configuration]
recipe = slapos.recipe.template:jinja2
template = {{ network_benck_cfg_output }}
rendered = ${monitor-directory:etc}/network_bench.cfg
mode = 0744
url = {{ network_benck_cfg_output }}
output = ${monitor-directory:etc}/network_bench.cfg
context =
key slapparameter_dict slap-configuration:configuration
......
......@@ -7,16 +7,16 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
[switch_softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = instance-base-monitor:rendered
edgetest = instance-base-edgetest:rendered
edgebot = instance-base-edgebot:rendered
edgetest-basic = instance-edgetest-basic:rendered
default = instance-base-monitor:output
edgetest = instance-base-edgetest:output
edgebot = instance-base-edgebot:output
edgetest-basic = instance-edgetest-basic:output
RootSoftwareInstance = $${:default}
[instance-base-monitor]
recipe = slapos.recipe.template:jinja2
template = ${template-monitor:target}
rendered = $${buildout:directory}/template-base-monitor.cfg
url = ${template-monitor:target}
output = $${buildout:directory}/template-base-monitor.cfg
extensions = jinja2.ext.do
context = key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
......@@ -26,12 +26,11 @@ context = key develop_eggs_directory buildout:develop-eggs-directory
raw monitor_template_output ${monitor-template:output}
raw network_benck_cfg_output ${network-bench-cfg:output}
raw monitor_collect_csv_dump ${monitor-collect-csv-dump:target}
mode = 0644
[instance-template]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
rendered = $${buildout:directory}/$${:_buildout_section_name_}.cfg
output = $${buildout:directory}/$${:_buildout_section_name_}.cfg
context =
import json_module json
import hashlib_module hashlib
......@@ -39,10 +38,9 @@ context =
key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration
key slap_software_type slap-configuration:slap-software-type
key instance_base_monitor instance-base-monitor:rendered
key instance_base_monitor instance-base-monitor:output
raw buildout_bin ${buildout:bin-directory}
$${:extra-context}
mode = 0644
[surykatka]
binary = ${buildout:bin-directory}/${surykatka:script-name}
......@@ -50,7 +48,7 @@ ini = ${template-surykatka-ini:target}
[instance-edgetest-basic]
<= instance-template
template = ${template-monitor-edgetest-basic:target}
url = ${template-monitor-edgetest-basic:target}
extra-context =
raw software_type edgetest-basic
key template_surykatka_ini surykatka:ini
......@@ -58,8 +56,8 @@ extra-context =
[instance-base-edgetest]
recipe = slapos.recipe.template:jinja2
template = ${template-monitor-edgetest:target}
rendered = $${buildout:directory}/template-monitor-base-edgetest.cfg
url = ${template-monitor-edgetest:target}
output = $${buildout:directory}/template-monitor-base-edgetest.cfg
extensions = jinja2.ext.do
context = import json_module json
import hashlib_module hashlib
......@@ -69,16 +67,15 @@ context = import json_module json
key slap_software_type slap-configuration:slap-software-type
section slap_configuration slap-configuration
raw software_type edgetest
key instance_base_monitor instance-base-monitor:rendered
key instance_base_monitor instance-base-monitor:output
key slave_instance_list slap-configuration:slave-instance-list
raw buildout_bin ${buildout:bin-directory}
raw template_json_edgetest_test ${json-test-template:target}
mode = 0644
[instance-base-edgebot]
recipe = slapos.recipe.template:jinja2
template = ${template-monitor-edgebot:target}
rendered = $${buildout:directory}/template-monitor-edgebot.cfg
url = ${template-monitor-edgebot:target}
output = $${buildout:directory}/template-monitor-edgebot.cfg
extensions = jinja2.ext.do
context = import json_module json
......@@ -94,7 +91,6 @@ context = import json_module json
raw buildout_bin ${buildout:bin-directory}
raw monitor_template_output ${monitor-template:output}
raw monitor_collect_csv_dump ${monitor-collect-csv-dump:target}
mode = 0644
[slap-configuration]
......
......@@ -14,4 +14,4 @@
# not need these here).
[template-instance]
filename = instance.cfg
md5sum = 14132bba14a1e66e7abb1a7c58b333e5
md5sum = 7a558c2b9461ec588c9d77bdeef64e4d
......@@ -44,7 +44,7 @@ git-executable = {{ git_path }}/bin/git
[parameters]
# for use of the "parameters" XML configuration given from the
# webrunner interface
# if needed, .serialized => json (more complex structures are OK, but need another
# if needed, .serialized => json (more complex structures are OK, but need another
# jinja template for reading the content of the parameters)
recipe = slapos.cookbook:slapconfiguration
computer = ${slap_connection:computer_id}
......@@ -82,10 +82,9 @@ config-command = ${promise-sudo-on-host-bin:wrapper-path}
[template-sudo-wrapper]
recipe = slapos.recipe.template:jinja2
template = {{ project_dir }}/scripts/wrapper_sudo.in
rendered = ${directory:wrapper_dir}/sudo
url = {{ project_dir }}/scripts/wrapper_sudo.in
output = ${directory:wrapper_dir}/sudo
md5sum = ded5a92be4e37ec32eb9d3087d3e19bd
mode = 0700
context =
key fake_cros_sdk_path bin:wrapper_cros_sdk
key bash_path bin:bash
......@@ -93,10 +92,9 @@ context =
[template-cros-sdk-wrapper]
recipe = slapos.recipe.template:jinja2
template = {{ project_dir }}/scripts/wrapper_cros_sdk.in
rendered = ${bin:wrapper_cros_sdk}
url = {{ project_dir }}/scripts/wrapper_cros_sdk.in
output = ${bin:wrapper_cros_sdk}
md5sum = 7159fe3d5b85a283733cf686c4ee0a74
mode = 0700
context =
# XXX bash path is the one from the host
key bash_path bin:bash
......@@ -107,10 +105,9 @@ context =
# create the rendered script in the buildout-directory/etc/run
# (use jinja for templating)
recipe = slapos.recipe.template:jinja2
template = {{ project_dir }}/scripts/cros_full_build.in
rendered = ${directory:run}/cros_full_build
url = {{ project_dir }}/scripts/cros_full_build.in
output = ${directory:run}/cros_full_build
#md5sum = f3b3b5408b69f752f2221d3965caf590
mode = 0700
context =
key bash_path bin:bash
key instance_log_dir directory:log
......
......@@ -35,9 +35,8 @@ eggs =
[template-instance]
# jinja2 render instance.cfg file in the buildout directory
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/${:filename}
mode = 0644
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
context =
key project_dir :_profile_base_location_
key software_dir buildout:directory
......@@ -47,7 +46,7 @@ context =
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
key thin_provisioning_tools thin-provisioning-tools:location
key monitor_template monitor2-template:rendered
key monitor_template monitor2-template:output
[thin-provisioning-tools]
recipe = slapos.recipe.cmmi
......
......@@ -14,7 +14,7 @@
# not need these here).
[instance-common]
filename = instance-common.cfg.in
md5sum = 2bd1779425b7561682c0de5496d808ed
md5sum = 402d09fbe2927f4f744ad6c0dc4329b9
[root-common]
filename = root-common.cfg.in
......@@ -30,7 +30,7 @@ md5sum = 9f27195d770b2f57461c60a82c851ab9
[instance-neo]
filename = instance-neo.cfg.in
md5sum = 74e0361f3ec3424c905acc4cd55fd8bf
md5sum = 03a6c72619b02f5100fa7ccc8dc0e5ea
[template-neo-my-cnf]
filename = my.cnf.in
......@@ -38,7 +38,7 @@ md5sum = a8939dcf440126a30db661b5a0a1bfb7
[template-neo]
filename = instance.cfg.in
md5sum = 3c7770c03c51ee12d5a94f0924e98990
md5sum = 78c46af020ebd0ff25a1b474a119695f
[cluster]
filename = cluster.cfg.in
......
......@@ -14,7 +14,7 @@ cert = ${slap-connection:cert-file}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
filename = ${:_buildout_section_name_}.cfg
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extensions =
jinja2.ext.do
jinja2.ext.loopcontrols
......@@ -31,18 +31,18 @@ context =
[neo-admin]
<= jinja2-template-base
template = {{ neo_admin }}
url = {{ neo_admin }}
[neo-master]
<= jinja2-template-base
template = {{ neo_master }}
url = {{ neo_master }}
[neo]
<= jinja2-template-base
template = {{ neo }}
url = {{ neo }}
extra-context =
key master_cfg neo-master:rendered
key admin_cfg neo-admin:rendered
key master_cfg neo-master:output
key admin_cfg neo-admin:output
{%- if mariadb_location is defined %}
raw mariadb_location {{ mariadb_location }}
raw template_mysqld_wrapper {{ template_mysqld_wrapper }}
......
......@@ -13,16 +13,16 @@
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:etc_run}/mariadb
private-tmpfs = {{ private_tmpfs }} ${my-cnf-parameters:tmp-directory}
command-line = ${mariadb-ns:rendered}
command-line = ${mariadb-ns:output}
[mariadb-ns]
rendered = ${directory:bin}/mariadb-ns
output = ${directory:bin}/mariadb-ns
{% else -%}
rendered = ${directory:etc_run}/mariadb
output = ${directory:etc_run}/mariadb
{% endif -%}
recipe = slapos.recipe.template:jinja2
template = {{ template_mysqld_wrapper }}
url = {{ template_mysqld_wrapper }}
context =
key defaults_file my-cnf:rendered
key defaults_file my-cnf:output
key datadir my-cnf-parameters:data-directory
[my-cnf-parameters]
......@@ -37,19 +37,19 @@ pid-file = ${directory:var_run}/mariadb.pid
error-log = ${directory:log}/mariadb_error.log
slow-query-log = ${directory:log}/mariadb_slowquery.log
extra-dict = {{ dumps(slapparameter_dict.get('mysql', {})) }}
init-file = ${init-script:rendered}
init-file = ${init-script:output}
engine = {{ slapparameter_dict.get('engine', '') }}
[my-cnf]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
rendered = ${directory:etc}/mariadb.cnf
template = {{ template_neo_my_cnf }}
output = ${directory:etc}/mariadb.cnf
url = {{ template_neo_my_cnf }}
context = section parameter_dict my-cnf-parameters
[binary-wrap-mysql]
recipe = slapos.cookbook:wrapper
command-line = '{{ mariadb_location }}/bin/${:command}' --defaults-file="${my-cnf:rendered}"
command-line = '{{ mariadb_location }}/bin/${:command}' --defaults-file="${my-cnf:output}"
wrapper-path = ${directory:bin}/${:command}
command = mysql
......@@ -89,8 +89,9 @@ admin =
[{{ section(name) }}]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/{{name}}
template = inline:{{'{{'}}pem}}
output = ${directory:etc}/{{name}}
inline =
{{'{{'}}pem}}
context = key pem :pem
pem = {{dumps(pem)}}
{%- endif %}
......@@ -152,10 +153,10 @@ srv = ${buildout:directory}/srv
{% if mysql -%}
[init-script]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template
# XXX: is there a better location ?
rendered = ${directory:etc}/mariadb_initial_setup.sql
template = inline:
output = ${directory:etc}/mariadb_initial_setup.sql
inline =
{{ init_list | join('\n\t') }}
[{{ section('logrotate-mysql') }}]
......@@ -171,14 +172,13 @@ post = ${binary-wrap-mysql:command-line} -e "FLUSH LOGS"
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/${:_buildout_section_name_}
private-tmpfs = {{ private_tmpfs }} ${directory:tmp}
command-line = ${runTestSuite-ns:rendered}
command-line = ${runTestSuite-ns:output}
[runTestSuite-ns]
{%- endif %}
recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/${:_buildout_section_name_}
template = {{ runTestSuite_in }}
mode = 0755
output = ${directory:bin}/${:_buildout_section_name_}
url = {{ runTestSuite_in }}
context =
section directory directory
section my_cnf_parameters my-cnf-parameters
......
......@@ -2,11 +2,11 @@
extends = {{ instance_common_cfg }}
[jinja2-template-base]
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}.cfg
output = ${buildout:parts-directory}/${:_buildout_section_name_}.cfg
[neo-cluster]
<= jinja2-template-base
template = {{ cluster }}
url = {{ cluster }}
extra-context =
import re re
import urllib_parse six.moves.urllib.parse
......@@ -22,7 +22,7 @@ extra-context +=
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
override = {{ dumps(override_switch_softwaretype |default) }}
default = neo-cluster:rendered
default = neo-cluster:output
# BBB
RootSoftwareInstance = ${:default}
neo = neo:rendered
neo = neo:output
......@@ -63,8 +63,8 @@ url = ${:_profile_base_location_}/${:filename}
# XXX: must be rendered, not just dled
[instance-common]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/${:_buildout_section_name_}.cfg
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:_buildout_section_name_}.cfg
context =
key bin_directory buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
......@@ -72,12 +72,12 @@ context =
key neo_admin instance-neo-admin:target
key neo_master instance-neo-master:target
key neo instance-neo:target
key template_logrotate_base template-logrotate-base:rendered
key template_monitor monitor2-template:rendered
key template_logrotate_base template-logrotate-base:output
key template_monitor monitor2-template:output
${:adapter-context}
adapter-context =
key mariadb_location mariadb:location
key template_mysqld_wrapper template-mysqld-wrapper:rendered
key template_mysqld_wrapper template-mysqld-wrapper:output
key template_neo_my_cnf template-neo-my-cnf:target
[root-common]
......@@ -96,11 +96,10 @@ adapter-context =
<= download-base-neo
[template-mysqld-wrapper]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/mysqld.in
mode = 644
template =
inline:{% raw %}#!/bin/sh -e
recipe = slapos.recipe.template
output = ${buildout:parts-directory}/${:_buildout_section_name_}/mysqld.in
inline =
#!/bin/sh -e
basedir='${mariadb:location}'
datadir='{{datadir}}'
marker=$datadir/.slapos_initializing
......@@ -121,7 +120,6 @@ template =
{%- endfor %}
{%- endif %}
exec "$basedir/bin/mysqld" --defaults-file='{{defaults_file}}' "$@"
{% endraw %}
[versions]
coverage = 4.5.1
......
......@@ -10,12 +10,12 @@ parts +=
[template-neo]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
url = ${:_profile_base_location_}/${:filename}
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
output = ${buildout:directory}/template.cfg
context =
key cluster cluster:target
key instance_common_cfg instance-common:rendered
key instance_common_cfg instance-common:output
key root_common root-common:target
key runTestSuite_in runTestSuite.in:target
${instance-common:adapter-context}
......
......@@ -10,9 +10,8 @@ parts =
[template]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/template.cfg
template =
inline:[buildout]
output = ${buildout:directory}/template.cfg
inline =[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
parts = runTestSuite
......@@ -28,9 +27,8 @@ template =
bin = $${buildout:directory}/bin
[runTestSuite]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
template = ${:_profile_base_location_}/$${:_buildout_section_name_}.in
mode = 0755
output = $${directory:bin}/$${:_buildout_section_name_}
url = ${:_profile_base_location_}/$${:_buildout_section_name_}.in
context =
section buildout buildout
section parameter_dict runTestSuite-parameters
......
......@@ -93,9 +93,9 @@ mode = 0755
# instance to run nxdtest.
[instance.cfg]
<= jinja2-template
template = inline:
inline =
[buildout]
extends = ${nxdtest-instance.cfg:rendered}
extends = ${nxdtest-instance.cfg:output}
parts += tnxdtest
[runTestSuite]
......
......@@ -26,4 +26,4 @@ md5sum = 6f42f0a8c5e5c0c657541a65c4d9ee57
[template-nextcloud-instance]
filename = nextcloud-instance.cfg.in
md5sum = 05f946a6523677e5dcf80e9fad230d1c
md5sum = 495b1693e451f6c5044c67ce5f1194fe
......@@ -43,7 +43,7 @@ rotate-num = 30
nextcloud = ${:document-root}
admin-user = admin
admin-password = admin
trusted-domain-list =
trusted-domain-list =
[${apache-php-configuration:ip}]:${apache-php-configuration:port}
${slap-parameter:instance.trusted-domain-1}
${slap-parameter:instance.trusted-domain-2}
......@@ -82,12 +82,11 @@ turn-secret = ${slap-parameter:instance.turn-secret}
[nextcloud-install.sh]
recipe = slapos.recipe.template:jinja2
template = {{ nextcloud_install_sh }}
rendered = ${directory:scripts}/nextcloud-install
url = {{ nextcloud_install_sh }}
output = ${directory:scripts}/nextcloud-install
context =
section parameter_dict instance-parameter
section nextcloud_apps nextcloud-apps
mode = 744
depends =
${service-redis:recipe}
${redis-promise:recipe}
......@@ -122,11 +121,10 @@ mode = 744
[nextcloud-apache-httpd]
recipe = slapos.recipe.template:jinja2
template = {{ nextcloud_apache_httpd }}
rendered = ${directory:apache.d}/nextcloud.conf
url = {{ nextcloud_apache_httpd }}
output = ${directory:apache.d}/nextcloud.conf
context =
section parameter_dict apache-php-configuration
mode = 744
[nextcloud-cron]
recipe = slapos.cookbook:cron.d
......@@ -176,19 +174,18 @@ recipe = collective.recipe.template
input = inline:#!/bin/sh
cd {{ news_updater_location }}
export PATH={{ php_location }}/bin:$PATH
{{ python3_location}}/bin/python3 -m nextcloud_news_updater --phpini ${php.ini-conf:rendered} \
{{ python3_location}}/bin/python3 -m nextcloud_news_updater --phpini ${php.ini-conf:output} \
--interval 300 --mode endless --loglevel info ${instance-parameter:nextcloud}
output = ${directory:scripts}/nextcloud-news-updater
mode = 744
[nextcloud-config.json]
recipe = slapos.recipe.template:jinja2
template = {{ nextcloud_parameter_json }}
rendered = ${directory:etc}/nextcloud-config.json
url = {{ nextcloud_parameter_json }}
output = ${directory:etc}/nextcloud-config.json
extensions = jinja2.ext.do
context =
section parameter_dict instance-parameter
mode = 600
[nextcloud-config-update]
output = ${directory:scripts}/nextcloud-update
......@@ -198,13 +195,13 @@ input = inline:#!/bin/sh
# do not run this script if nextcloud is not installed yet.
exit 1;
fi
${php-bin:wrapper-path} ${instance-parameter:nextcloud}/occ config:import ${nextcloud-config.json:rendered}
${php-bin:wrapper-path} ${instance-parameter:nextcloud}/occ config:import ${nextcloud-config.json:output}
mode = 744
[php-bin]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/php
command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:rendered}
command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:output}
[publish-connection-information]
admin-user = ${instance-parameter:admin-user}
......
......@@ -23,8 +23,8 @@ md5sum = d81902d2dec5d547779bec6336a438be
[template-nextcloud-instance]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/instance-nextcloud.cfg
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance-nextcloud.cfg
extensions = jinja2.ext.do
context =
key gzip_location gzip:location
......@@ -39,7 +39,7 @@ context =
section nextcloud_apps nextcloud-apps
[custom-application-deployment]
path = ${template-nextcloud-instance:rendered}
path = ${template-nextcloud-instance:output}
part-list = nextcloud-install.sh
[nc-download-unpacked]
......
[template]
filename = instance.cfg.in
md5sum = 87fd83d33ba786550a45f484b3ae2b24
md5sum = 6482b6aea742357350f0d7e350f9baa6
[template-nginx-configuration]
filename = template-nginx.cfg.in
......
......@@ -6,7 +6,7 @@ parts =
logrotate-entry-nginx
promises
publish-connection-information
extends = ${monitor-template:rendered}
extends = ${monitor-template:output}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
......@@ -46,7 +46,6 @@ command-line =
recipe = slapos.recipe.template
url = ${template-nginx-configuration:output}
output = $${directory:etc}/nginx.cfg
mode = 0600
access-log = $${directory:log}/nginx-access.log
error-log = $${directory:log}/nginx-error.log
pid-file = $${directory:run}/nginx.pid
......
......@@ -19,10 +19,8 @@ part = python3
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/template.cfg
mode = 0644
[template-nginx-configuration]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template-nginx.cfg.in
mode = 0644
......@@ -16,7 +16,7 @@
[template]
filename = instance.cfg
md5sum = 6ea4fa210a91c15278c847a809de5991
md5sum = cdda32a8e0b4a5037b5d42fe53a32fe6
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
......@@ -24,7 +24,7 @@ md5sum = 1358f8e0a4cecefe4cdf389b69067f34
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = e4c224da723ad56091f27ed5c0b0bbca
md5sum = 71ca45e186afbc3be8e6d6f541142bf7
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
......@@ -32,11 +32,11 @@ md5sum = b15e678779dee0a26746487990fedc01
[template-lte-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum = 9c275dde5c485c05f92a9be053f10593
md5sum = b1bb29784c9f71ab0dd41e5cd9970784
[template-lte-epc]
_update_hash_filename_ = instance-epc.jinja2.cfg
md5sum = 35556ebd82be804584482a7fe5eff0be
md5sum = 7266e97e2aad20c4c224e1663139535b
[ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg
......
......@@ -53,9 +53,8 @@ log = ${:var}/log
[ltelogs]
recipe = slapos.recipe.template:jinja2
template = {{ ltelogs_template }}
rendered = ${directory:home}/ltelogs.sh
mode = 0775
url = {{ ltelogs_template }}
output = ${directory:home}/ltelogs.sh
extensions = jinja2.ext.do
context =
section directory directory
......@@ -69,33 +68,31 @@ offline = false
{% endif %}
[lte-enb-sh-wrapper]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/${:_buildout_section_name_}
mode = 0700
template =
inline:#!/bin/sh
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
sudo /opt/amarisoft/rm-tmp-lte | true;
{{ enb }}/lteenb ${directory:etc}/enb.cfg >> ${directory:log}/enb-output.cfg 2>> ${directory:log}/enb-output.cfg
### eNodeB (enb)
[lte-enb-service]
recipe = slapos.cookbook:wrapper
init = ${ltelogs:rendered} ${directory:log}/enb.log; sleep 2
command-line = ${lte-enb-sh-wrapper:rendered}
init = ${ltelogs:output} ${directory:log}/enb.log; sleep 2
command-line = ${lte-enb-sh-wrapper:output}
wrapper-path = ${directory:service}/lte-enb
mode = 0775
reserve-cpu = True
pidfile = ${directory:run}/enb.pid
hash-files =
${lte-enb-config:rendered}
${lte-enb-sh-wrapper:rendered}
${lte-enb-config:output}
${lte-enb-sh-wrapper:output}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[config-base]
recipe = slapos.recipe.template:jinja2
mode = 0664
extensions = jinja2.ext.do
context =
section directory directory
......@@ -107,11 +104,11 @@ context =
[lte-enb-config]
<= config-base
{% if slapparameter_dict.get("enb_config_link", None) %}
template = ${enb-config-dl:target}
url = ${enb-config-dl:target}
{% else %}
template = {{ enb_template }}
url = {{ enb_template }}
{% endif %}
rendered = ${directory:etc}/enb.cfg
output = ${directory:etc}/enb.cfg
[publish-connection-information]
<= monitor-publish
......
......@@ -51,9 +51,8 @@ log = ${:var}/log
[ltelogs]
recipe = slapos.recipe.template:jinja2
template = {{ ltelogs_template }}
rendered = ${directory:home}/ltelogs.sh
mode = 0775
url = {{ ltelogs_template }}
output = ${directory:home}/ltelogs.sh
extensions = jinja2.ext.do
context =
section directory directory
......@@ -69,22 +68,21 @@ offline = false
### IMS
[lte-ims-service]
recipe = slapos.cookbook:wrapper
init = ${ltelogs:rendered} ${directory:log}/ims.log; sleep 1
init = ${ltelogs:output} ${directory:log}/ims.log; sleep 1
command-line = {{ mme }}/lteims ${directory:etc}/ims.cfg
wrapper-path = ${directory:service}/lte-ims
mode = 0775
pidfile = ${directory:run}/ims.pid
hash-files =
${lte-ims-config:rendered}
${lte-ims-config:output}
{{ ue_db_path }}
environment = AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[lte-mme-sh-wrapper]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/${:_buildout_section_name_}
mode = 0700
template =
inline:#!/bin/sh
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
rm -f ${directory:var}/lte_ue.db;
{{ mme }}/ltemme ${directory:etc}/mme.cfg >> ${directory:log}/mme-output.cfg 2>> ${directory:log}/mme-output.cfg
......@@ -93,15 +91,15 @@ template =
recipe = slapos.cookbook:wrapper
# When the machine shutdowns abruptly, lte_ue is not cleaned up which causes
# amarisoft ltemme to fail. TODO: find a cleaner way to handle this
init = ${ltelogs:rendered} ${directory:log}/mme.log
command-line = ${lte-mme-sh-wrapper:rendered}
init = ${ltelogs:output} ${directory:log}/mme.log
command-line = ${lte-mme-sh-wrapper:output}
wrapper-path = ${directory:service}/lte-mme
mode = 0775
pidfile = ${directory:run}/mme.pid
hash-files =
${lte-mme-config:rendered}
${lte-mme-config:output}
{{ ue_db_path }}
${lte-mme-sh-wrapper:rendered}
${lte-mme-sh-wrapper:output}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
......@@ -115,7 +113,6 @@ mode = 775
[config-base]
recipe = slapos.recipe.template:jinja2
mode = 0664
extensions = jinja2.ext.do
context =
section directory directory
......@@ -125,17 +122,17 @@ context =
[lte-ims-config]
<= config-base
template = {{ ims_template }}
rendered = ${directory:etc}/ims.cfg
url = {{ ims_template }}
output = ${directory:etc}/ims.cfg
[lte-mme-config]
<= config-base
{% if slapparameter_dict.get("mme_config_link", None) %}
template = ${mme-config-dl:target}
url = ${mme-config-dl:target}
{% else %}
template = {{ mme_template }}
url = {{ mme_template }}
{% endif %}
rendered = ${directory:etc}/mme.cfg
output = ${directory:etc}/mme.cfg
context =
section directory directory
section slap_configuration slap-configuration
......
......@@ -60,9 +60,8 @@ log = ${:var}/log
[ltelogs]
recipe = slapos.recipe.template:jinja2
template = {{ ltelogs_template }}
rendered = ${directory:home}/ltelogs.sh
mode = 0775
url = {{ ltelogs_template }}
output = ${directory:home}/ltelogs.sh
extensions = jinja2.ext.do
context =
section directory directory
......@@ -76,33 +75,31 @@ offline = false
{% endif %}
[lte-enb-sh-wrapper]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/${:_buildout_section_name_}
mode = 0700
template =
inline:#!/bin/sh
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
sudo /opt/amarisoft/rm-tmp-lte | true;
{{ enb }}/lteenb ${directory:etc}/gnb.cfg >> ${directory:log}/gnb-output.cfg 2>> ${directory:log}/gnb-output.cfg
### eNodeB (enb)
[lte-enb-service]
recipe = slapos.cookbook:wrapper
init = ${ltelogs:rendered} ${directory:log}/enb.log; sleep 2
command-line = ${lte-enb-sh-wrapper:rendered}
init = ${ltelogs:output} ${directory:log}/enb.log; sleep 2
command-line = ${lte-enb-sh-wrapper:output}
wrapper-path = ${directory:service}/lte-enb
mode = 0775
reserve-cpu = True
pidfile = ${directory:run}/enb.pid
hash-files =
${lte-gnb-config:rendered}
${lte-enb-sh-wrapper:rendered}
${lte-gnb-config:output}
${lte-enb-sh-wrapper:output}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[config-base]
recipe = slapos.recipe.template:jinja2
mode = 0664
extensions = jinja2.ext.do
context =
section directory directory
......@@ -114,11 +111,11 @@ context =
[lte-gnb-config]
<= config-base
{% if slapparameter_dict.get("gnb_config_link", None) %}
template = ${gnb-config-dl:target}
url = ${gnb-config-dl:target}
{% else %}
template = {{ gnb_template }}
url = {{ gnb_template }}
{% endif %}
rendered = ${directory:etc}/gnb.cfg
output = ${directory:etc}/gnb.cfg
[publish-connection-information]
<= monitor-publish
......
......@@ -16,7 +16,7 @@ cert = $${slap-connection:cert-file}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/$${:filename}
output = $${buildout:directory}/$${:filename}
extra-context =
context =
import json_module json
......@@ -29,11 +29,11 @@ context =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
enb-epc = dynamic-template-lte-enb-epc:rendered
gnb-epc = dynamic-template-lte-gnb-epc:rendered
enb = dynamic-template-lte-enb:rendered
gnb = dynamic-template-lte-gnb:rendered
epc = dynamic-template-lte-epc:rendered
enb-epc = dynamic-template-lte-enb-epc:output
gnb-epc = dynamic-template-lte-gnb-epc:output
enb = dynamic-template-lte-enb:output
gnb = dynamic-template-lte-gnb:output
epc = dynamic-template-lte-epc:output
RootSoftwareInstance = $${:enb-epc}
[local-ipv4-address]
......@@ -52,29 +52,29 @@ init =
[dynamic-template-lte-enb-epc]
< = jinja2-template-base
template = ${template-lte-enb-epc:target}
url = ${template-lte-enb-epc:target}
filename = instance-lte-enb-epc.cfg
extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
raw monitor_template ${monitor2-template:output}
key local_ipv4 local-ipv4-address:local-ipv4
[dynamic-template-lte-gnb-epc]
< = jinja2-template-base
template = ${template-lte-gnb-epc:target}
url = ${template-lte-gnb-epc:target}
filename = instance-lte-gnb-epc.cfg
extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
raw monitor_template ${monitor2-template:output}
key local_ipv4 local-ipv4-address:local-ipv4
[dynamic-template-lte-enb]
< = jinja2-template-base
template = ${template-lte-enb:target}
url = ${template-lte-enb:target}
filename = instance-lte-enb.cfg
extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
raw monitor_template ${monitor2-template:output}
raw enb ${enb:destination}
raw enb_template ${enb.jinja2.cfg:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
......@@ -92,11 +92,11 @@ extra-context =
[dynamic-template-lte-gnb]
< = jinja2-template-base
template = ${template-lte-gnb:target}
url = ${template-lte-gnb:target}
filename = instance-lte-gnb.cfg
extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
raw monitor_template ${monitor2-template:output}
raw enb ${enb:destination}
raw gnb_template ${gnb.jinja2.cfg:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
......@@ -114,11 +114,11 @@ extra-context =
[dynamic-template-lte-epc]
< = jinja2-template-base
template = ${template-lte-epc:target}
url = ${template-lte-epc:target}
filename = instance-lte-epc.cfg
extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
raw monitor_template ${monitor2-template:output}
raw interface_up_promise ${interface-up-promise:target}
raw mme ${mme:destination}
raw mme_template ${mme.jinja2.cfg:target}
......@@ -126,13 +126,13 @@ extra-context =
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw openssl_location ${openssl:location}
raw nghttp2_location ${nghttp2:location}
key ue_db_path ue-db-config:rendered
key ue_db_path ue-db-config:output
[ue-db-config]
recipe = slapos.recipe.template:jinja2
template = ${ue_db.jinja2.cfg:target}
url = ${ue_db.jinja2.cfg:target}
filename = ue_db.cfg
extensions = jinja2.ext.do
rendered = $${buildout:directory}/$${:filename}
output = $${buildout:directory}/$${:filename}
context =
key slave_instance_list slap-configuration:slave-instance-list
......@@ -28,7 +28,6 @@ parts +=
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 0644
[download-base]
recipe = slapos.recipe.build:download
......@@ -58,7 +57,7 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
[amarisoft]
recipe = slapos.recipe.build
path = /opt/amarisoft/lte
init =
init =
import os
options['lte-version'] = os.readlink(options["path"])[:-1]
......
......@@ -15,7 +15,7 @@
[instance]
filename = instance.cfg.in
md5sum = de38ed0348a9d50e01dbf383a661d53e
md5sum = 51597d8161458028ea8b46962d378a70
[tomcat-server-xml]
filename = server.xml.in
......
......@@ -7,12 +7,12 @@ eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
extends = ${monitor2-template:rendered}
extends = ${monitor2-template:output}
[fontconfig-conf]
recipe = slapos.recipe.template:jinja2
template = ${template-fonts-conf:output}
rendered = $${directory:etc}/fonts.conf
url = ${template-fonts-conf:output}
output = $${directory:etc}/fonts.conf
context =
key cachedir directory:fontconfig-cache
key fonts :fonts
......@@ -62,7 +62,7 @@ environment =
JRE_HOME=${java-re-8:location}
CATALINA_BASE=$${directory:catalina_base}
GRAPHVIZ_DOT=${graphviz:location}/bin/dot
FONTCONFIG_FILE=$${fontconfig-conf:rendered}
FONTCONFIG_FILE=$${fontconfig-conf:output}
LD_LIBRARY_PATH=${fontconfig:location}/lib:${freetype:location}/lib
# XXX java is still loading system fonts ... ( even with $JAVA_FONTS or -Djava.awt.fonts )
# related links:
......
[buildout]
extends =
extends =
../../stack/slapos.cfg
../../component/postgresql/buildout.cfg
......@@ -18,4 +18,3 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
md5sum = d8b833a2054b82b6031a9420008b58fd
mode = 0644
......@@ -14,11 +14,11 @@
# not need these here).
[template]
filename = instance.cfg
md5sum = fddea033e1aa9d6147a1a47bd7cc4b62
md5sum = 2f812f4814a0cc78a8b96d8014ac3104
[template-powerdns]
filename = instance-powerdns.cfg
md5sum = a6fcfcef942cd9b57c2b0c69e318362c
md5sum = 3aab17e4228bd33a9d25d9a8910ffa5c
[template-pdns-configuration]
_update_hash_filename_ = template/pdns.conf.jinja2
......@@ -26,7 +26,7 @@ md5sum = 851353e1d4dd562ace58b3345c2da515
[template-dns-replicate]
_update_hash_filename_ = instance-powerdns-replicate.cfg.jinja2
md5sum = 5b4b46136c6547c27508c4789ac5d0ee
md5sum = f0a127e858f49beff4a5fcd2e71c088d
[iso-list]
_update_hash_filename_ = template/zz.countries.nexedi.dk.rbldnsd
......
......@@ -2,7 +2,7 @@
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
output = ${buildout:directory}/${:filename}
extra-context =
context =
import json_module json
......
......@@ -8,7 +8,7 @@ bin = $${buildout:directory}/bin/
etc = $${buildout:directory}/etc/
srv = $${buildout:directory}/srv/
var = $${buildout:directory}/var/
template = $${buildout:directory}/template/
url = $${buildout:directory}/template/
backup = $${:srv}/backup
log = $${:var}/log
......@@ -39,7 +39,7 @@ cert = $${slap-connection:cert-file}
# Generic jinja section to extend
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/$${:filename}
output = $${buildout:directory}/$${:filename}
extra-context =
context =
import json_module json
......@@ -62,7 +62,7 @@ socket-directory = $${pdns-directory:socket-directory}
webserver-port = 8088
[geo]
zones-file = $${zones-file-template:rendered}
zones-file = $${zones-file-template:output}
database = ${geolite2-country:location}/GeoLite2-Country.mmdb
[pdns-directory]
......@@ -72,8 +72,8 @@ socket-directory = $${directory:run}/
[pdns-configuration-template]
< = jinja2-template-base
template = ${template-pdns-configuration:target}
rendered = $${pdns:configuration}
url = ${template-pdns-configuration:target}
output = $${pdns:configuration}
extra-context =
section pdns pdns
section geo geo
......@@ -104,9 +104,9 @@ init =
[zones-file-template]
< = jinja2-template-base
template = ${template-zones-file:target}
url = ${template-zones-file:target}
extensions = jinja2.ext.do
rendered = $${pdns-directory:configuration}/zones-file.yml
output = $${pdns-directory:configuration}/zones-file.yml
extra-context =
section asia asia
key china china:ip-split
......@@ -126,11 +126,11 @@ wrapper-path = $${directory:etc-run}/pdns-reload
# Port redirection
[port-redirection]
<= jinja2-template-base
template = inline:
inline =
{%- raw %}
[{"srcPort": 53, "destPort": {{ pdns['port'] }}}]
{% endraw -%}
rendered = $${buildout:directory}/.slapos-port-redirect
output = $${buildout:directory}/.slapos-port-redirect
extra-context =
section pdns pdns
......
......@@ -9,15 +9,15 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-powerdns-replicate:rendered
single-default = dynamic-template-powerdns:rendered
default = dynamic-powerdns-replicate:output
single-default = dynamic-template-powerdns:output
# BBB
RootSoftwareInstance = $${:default}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/$${:filename}
output = $${buildout:directory}/$${:filename}
extra-context =
context =
import json_module json
......@@ -30,7 +30,7 @@ context =
[dynamic-template-powerdns]
< = jinja2-template-base
template = ${template-powerdns:output}
url = ${template-powerdns:output}
filename = instance-powerdns.cfg
extensions = jinja2.ext.do
extra-context =
......@@ -39,13 +39,13 @@ extra-context =
[dynamic-powerdns-replicate]
< = jinja2-template-base
template = ${template-dns-replicate:target}
url = ${template-dns-replicate:target}
filename = instance-powerdns-replicate.cfg
extensions = jinja2.ext.do
extra-context =
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type RootSoftwareInstance-default
raw template_monitor ${monitor2-template:rendered}
raw template_monitor ${monitor2-template:output}
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
......
......@@ -15,11 +15,11 @@
[instance-profile]
filename = instance.cfg.in
md5sum = b62dd8dd89ef6627ebac20987a89a069
md5sum = 39cdfbd3bdfcd48eddb4132ff9dcda62
[instance-default]
filename = instance-default.cfg.in
md5sum = 16d592805c6c1756e54924242148ba85
md5sum = 6b8ab50d49136291024c8327aa0931e9
[proftpd-config-file]
filename = proftpd-config-file.cfg.in
......
......@@ -38,9 +38,8 @@ ssh-authorized-keys-dir = ${:etc}/authorized_keys/
[config-file]
recipe = slapos.recipe.template:jinja2
template = {{ software_parts_directory }}/${:_buildout_section_name_}/${:_buildout_section_name_}.cfg.in
rendered = ${directory:etc}/${:_buildout_section_name_}.cfg
mode = 0644
url = {{ software_parts_directory }}/${:_buildout_section_name_}/${:_buildout_section_name_}.cfg.in
output = ${directory:etc}/${:_buildout_section_name_}.cfg
extensions = jinja2.ext.do
[proftpd-userinfo]
......@@ -69,7 +68,7 @@ ban-log=${directory:log}/proftpd-ban.log
ssh-host-rsa-key=${ssh-host-rsa-key:output}
ssh-host-dsa-key=${ssh-host-dsa-key:output}
ssh-host-ecdsa-key=${ssh-host-ecdsa-key:output}
ssh-authorized-key = ${ssh-authorized-keys:rendered}
ssh-authorized-key = ${ssh-authorized-keys:output}
ban-table=${directory:srv}/proftpd-ban-table
control-socket=${directory:var}/proftpd.sock
auth-user-file=${auth-user-file:output}
......@@ -77,14 +76,14 @@ authentication-url = {{ slapparameter_dict.get('authentication-url', '')}}
recipe = slapos.cookbook:wrapper
command-line =
{{ proftpd_bin }} --nodaemon --config ${proftpd-config-file:rendered}
{{ proftpd_bin }} --nodaemon --config ${proftpd-config-file:output}
wrapper-path = ${directory:service}/proftpd
[ssh-authorized-keys]
rendered = ${directory:ssh-authorized-keys-dir}/authorized_keys
output = ${directory:ssh-authorized-keys-dir}/authorized_keys
{% if slapparameter_dict.get('ssh-key') %}
recipe = slapos.recipe.template:jinja2
template = inline:{{ slapparameter_dict['ssh-key'] | indent }}
recipe = slapos.recipe.template
inline ={{ slapparameter_dict['ssh-key'] | indent }}
{% endif %}
[proftpd-listen-promise]
......
......@@ -14,8 +14,7 @@ cert = ${slap-connection:cert-file}
[instance-template]
recipe = slapos.recipe.template:jinja2
filename = ${:_buildout_section_name_}.cfg
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
mode = 0644
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
......@@ -28,12 +27,12 @@ context =
[instance-default]
<= instance-template
template = {{ instance_default }}
url = {{ instance_default }}
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
# XXX Jerome: what is this override for ?
override = {{ dumps(override_switch_softwaretype |default) }}
default = instance-default:rendered
default = instance-default:output
# BBB
RootSoftwareInstance = ${:default}
......@@ -27,8 +27,8 @@ url = ${:_profile_base_location_}/${:filename}
[instance-profile]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
......@@ -37,7 +37,7 @@ context =
key ftpasswd_bin proftpd-output:ftpasswd
key ftpdctl_bin proftpd-output:ftpdctl
key ssh_keygen_bin openssh-output:keygen
raw template_monitor ${monitor2-template:rendered}
raw template_monitor ${monitor2-template:output}
[versions]
plone.recipe.command = 1.1
......@@ -15,4 +15,4 @@
[instance-profile]
filename = instance.cfg.in
md5sum = 9c4336f1f5143d3281c6706ff14abdd3
md5sum = 1bc53986f27cc513d4fbe8beb4f98c50
......@@ -59,10 +59,10 @@ data-dir = ${directory:pureftpd-dir}
pid-file=${directory:run}/pureftpd.pid
auth-user-file=${auth-user-file:output}
recipe =slapos.recipe.template:jinja2
recipe =slapos.recipe.template
# WARNING pure-uploadscript must be launched AFTER pure-ftpd so keep them in the same wrapper
# and make sure they are both killed if one of them is killed.
template = inline:
inline =
#!{{ bash_location }}/bin/bash
{{ pureftpd_bin }} --uploadscript --customerproof --bind ${:host},${:ftp-port} --login puredb:${:auth-user-file} --pidfile ${:pid-file} &
while ! [ -p ${directory:run}/pure-ftpd.upload.pipe ]
......@@ -72,8 +72,8 @@ template = inline:
{{ pureuploadscript_bin }} -r /opt/pureftpd/upload_script &
wait -n
kill 0
rendered = ${directory:service}/pureftpd
wrapper-path = ${:rendered}
output = ${directory:service}/pureftpd
wrapper-path = ${:output}
[pure-pw]
# command line to add a user, invoke with:
......@@ -89,7 +89,7 @@ command-line =
recipe = plone.recipe.command
passwd-file = ${directory:etc}/pureftpd.passwd
output = ${directory:etc}/pureftpd.pdb
command =
command =
if [ -f ${:passwd-file} ] && {{ purepw_bin }} show ${pureftpd-password:username} -f ${:passwd-file}
then
( echo ${pureftpd-password:passwd} ; echo ${pureftpd-password:passwd}) | {{ purepw_bin }} passwd ${pureftpd-password:username} -f ${:passwd-file}
......
......@@ -9,13 +9,13 @@ extends =
parts =
slapos-cookbook
instance-profile
[python]
part = python3
# force to install plone.recipe.command as it will be used during instanciation
# force to install plone.recipe.command as it will be used during instanciation
[slapos-cookbook]
eggs +=
plone.recipe.command
......@@ -23,14 +23,13 @@ eggs +=
[instance-profile]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/instance.cfg
mode = 0644
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
key bash_location bash:location
raw monitor_rendered ${monitor-template:rendered}
raw monitor_rendered ${monitor-template:output}
raw pureftpd_bin ${pure-ftpd:location}/sbin/pure-ftpd
raw pureuploadscript_bin ${pure-ftpd:location}/sbin/pure-uploadscript
raw purepw_bin ${pure-ftpd:location}/bin/pure-pw
......@@ -14,11 +14,11 @@
# not need these here).
[template]
filename = instance.cfg.in
md5sum = 71531ed9c9b79fa769ab367e7ea2d2a5
md5sum = 7be0c21751f8385ef876c3d7192d4057
[template-re6stnet]
filename = instance-re6stnet.cfg.in
md5sum = a9cd303d17c4f07ad11fc8099afeed24
md5sum = 416b5c94810332adf938608e0556fdb4
[template-apache-conf]
filename = apache.conf.in
......
......@@ -25,8 +25,8 @@ run = ${directory:run}/re6stnet
[apache-conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-apache-conf'] }}
rendered = ${directory:etc}/apache.conf
url = {{ parameter_dict['template-apache-conf'] }}
output = ${directory:etc}/apache.conf
ipv6 = {{ ipv6 }}
port = 9026
error-log = ${directory:log}/apache-error.log
......@@ -44,16 +44,17 @@ context =
[apache-httpd]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/httpd
command-line = "{{ parameter_dict['apache-location'] }}/bin/httpd" -f "${apache-conf:rendered}" -DFOREGROUND
command-line = "{{ parameter_dict['apache-location'] }}/bin/httpd" -f "${apache-conf:output}" -DFOREGROUND
[apache-httpd-graceful]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:script}/httpd-graceful
template = inline:{{'{{content}}'}}
output = ${directory:script}/httpd-graceful
inline =
{{'{{content}}'}}
context = key content :script
script =
#!/bin/sh -e
{{ parameter_dict['apache-location'] }}/bin/httpd -Sf ${apache-conf:rendered}
{{ parameter_dict['apache-location'] }}/bin/httpd -Sf ${apache-conf:output}
{{ bin_directory }}/slapos-kill --pidfile ${apache-conf:pid-file} -s USR1
[logrotate-apache]
......@@ -89,21 +90,22 @@ community-path = ${re6st-community-conf:output}
[re6st-community-conf]
recipe = slapos.recipe.template
inline = {{ dumps(community) }}
inline =
{{ dumps(community) }}
output = ${re6stnet-dirs:conf}/community.conf
{%- endif %}
[re6st-registry-conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-re6st-registry-conf'] }}
rendered = ${re6stnet-dirs:conf}/registry.conf
url = {{ parameter_dict['template-re6st-registry-conf'] }}
output = ${re6stnet-dirs:conf}/registry.conf
context = section parameter_dict re6st-registry-conf-dict
[re6st-registry-wrapper]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/re6st-registry
pidfile = ${directory:run}/registry.pid
command-line = {{ bin_directory }}/re6st-registry @${re6st-registry-conf:rendered}
command-line = {{ bin_directory }}/re6st-registry @${re6st-registry-conf:output}
[cron-entry-re6st-backup]
recipe = slapos.cookbook:cron.d
......@@ -123,7 +125,7 @@ conf-dir = ${re6stnet-dirs:conf}
token-dir = ${re6stnet-dirs:token}
#Re6st config
config-file = ${re6st-registry-conf:rendered}
config-file = ${re6st-registry-conf:output}
port = ${re6st-registry-conf-dict:port}
ipv4 = ${re6st-registry-conf-dict:ipv4}
db-path = ${re6st-registry-conf-dict:db}
......@@ -155,11 +157,11 @@ post = [ ! -s ${re6st-registry-wrapper:pidfile} ] || {{ bin_directory }}/slapos-
[port-redirection]
recipe = slapos.recipe.template:jinja2
template = inline:
inline =
{%- raw %}
[{"srcPort": 9201, "destPort": 9201, "destAddress": "{{ parameter_dict['ipv4'] }}"}]
{% endraw -%}
rendered = ${buildout:directory}/.slapos-port-redirect
output = ${buildout:directory}/.slapos-port-redirect
context =
section parameter_dict re6st-registry-conf-dict
......
......@@ -13,7 +13,7 @@ cert = ${slap-connection:cert-file}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extra-context =
context =
key ipv6_set slap-configuration:ipv6
......@@ -34,7 +34,7 @@ template-re6st-registry-conf = {{ template_re6st_registry_conf }}
[dynamic-template-re6stnet]
< = jinja2-template-base
template = {{ template_re6stnet }}
url = {{ template_re6stnet }}
filename = instance-re6stnet.cfg
extensions = jinja2.ext.do
extra-context =
......@@ -45,7 +45,7 @@ extra-context =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-template-re6stnet:rendered
default = dynamic-template-re6stnet:output
registry = ${:default}
# BBB
RootSoftwareInstance = ${:default}
......@@ -48,9 +48,9 @@ depends = ${re6stnet-develop:recipe}
[re6stnet-backup]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:bin-directory}/re6st-backup
template =
inline:#!/bin/sh -e
output = ${buildout:bin-directory}/re6st-backup
inline =
#!/bin/sh -e
PATH={{git_location}}/bin:{{sqlite3_location}}/bin:$PATH
cd "$1" || {
rm -rf "$1.new"
......@@ -75,8 +75,8 @@ url = ${:_profile_base_location_}/${:filename}
[template]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/instance.cfg
template = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
context =
key bin_directory buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
......@@ -84,12 +84,12 @@ context =
key apache_location apache:location
key logrotate_location logrotate:location
key openssl_location openssl:location
key re6stnet_backup re6stnet-backup:rendered
key re6stnet_backup re6stnet-backup:output
key template_apache_conf template-apache-conf:target
key template_re6stnet template-re6stnet:target
key template_re6st_registry_conf template-re6st-registry-conf:target
key template_logrotate_base template-logrotate-base:rendered
key monitor2_template_rendered monitor2-template:rendered
key template_logrotate_base template-logrotate-base:output
key monitor2_template_rendered monitor2-template:output
raw python_with_eggs ${buildout:bin-directory}/${re6stnet:interpreter}
[template-re6stnet]
......
......@@ -14,11 +14,11 @@
# not need these here).
[instance.cfg]
filename = instance.cfg.in
md5sum = 1c9c4c254f371337fe08b7922901f8a9
md5sum = 55c7fd4dd6a39b31878889fbfb00f995
[instance-repman.cfg]
_update_hash_filename_ = instance-repman.cfg.jinja2.in
md5sum = 7782adde357c9444fed51f2dcc230a52
md5sum = 4ce8808677773a033f4b59bdf6b8e653
[config-toml.in]
_update_hash_filename_ = templates/config.toml.in
......@@ -34,7 +34,7 @@ md5sum = 0eeb24c6aa0760f0d33c4cc2828ddf30
[template-mariadb.cfg]
_update_hash_filename_ = instance-mariadb.cfg.jinja2.in
md5sum = aa25693b324ce5acc00f29b96a2516c0
md5sum = 34eed1b6d7fc45dc078f30235e22d04f
[template-my-cnf]
_update_hash_filename_ = templates/my.cnf.in
......
......@@ -23,16 +23,8 @@ partition-path = ${buildout:directory}
receiver-port = ${dbjob-parameter:socat-port}
csr-id = ${caucase-csr-id:csr-id}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
mode = 644
[jinja2-template-executable]
< = jinja2-template-base
mode = 755
[jinja2-template-script-base]
< = jinja2-template-executable
recipe = slapos.recipe.template:jinja2
context =
key tmp_dir directory:tmp
key partition_dir buildout:directory
......@@ -48,8 +40,9 @@ context =
${:extra-context}
[simplefile]
< = jinja2-template-base
template = inline:{{ '{{ content }}' }}
recipe = slapos.recipe.template:jinja2
inline =
{{ '{{ content }}' }}
{% macro simplefile(section_name, file_path, content, mode='') -%}
{% set content_section_name = section_name ~ '-content' -%}
......@@ -58,7 +51,7 @@ content = {{ dumps(content) }}
[{{ section(section_name) }}]
< = simplefile
rendered = {{ file_path }}
output = {{ file_path }}
context = key content {{content_section_name}}:content
mode = {{ mode }}
{%- endmacro %}
......@@ -85,7 +78,7 @@ mode = {{ mode }}
[get-csr-id]
recipe = plone.recipe.command
output = ${directory:tmp}/csr_id
command =
command =
if [ -s "${mysql-directory:ssl}/server-cert.pem" ]; then
RESULT="None";
else
......@@ -122,17 +115,16 @@ innodb-log-buffer-size = {{ dumps(slapparameter_dict.get('innodb-log-buffer-size
relaxed-writes = {{ dumps(slapparameter_dict.get('relaxed-writes', False)) }}
[my-cnf]
< = jinja2-template-base
rendered = ${directory:etc}/mariadb.cnf
template = {{ parameter_dict['template-my-cnf'] }}
recipe = slapos.recipe.template:jinja2
output = ${directory:etc}/mariadb.cnf
url = {{ parameter_dict['template-my-cnf'] }}
context = section parameter_dict my-cnf-parameters
[init-root-sql]
< = jinja2-template-base
rendered = ${directory:etc}/.init-root.sql
template = {{ parameter_dict['template-mariadb-init-root'] }}
recipe = slapos.recipe.template:jinja2
output = ${directory:etc}/.init-root.sql
url = {{ parameter_dict['template-mariadb-init-root'] }}
context = section parameter_dict init-script-parameters
mode = 600
[init-script-parameters]
password = {{ slapparameter_dict['root-password'] }}
......@@ -143,11 +135,11 @@ heartbeat-user = {{ slapparameter_dict['heartbeat-user'] }}
require-ssl = {{ dumps(slapparameter_dict['require-ssl']) }}
[init-script]
< = jinja2-template-executable
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
# XXX: is there a better location ?
rendered = ${directory:etc}/mariadb_initial_setup.sql
template = {{ parameter_dict['template-mariadb-initial-setup'] }}
output = ${directory:etc}/mariadb_initial_setup.sql
url = {{ parameter_dict['template-mariadb-initial-setup'] }}
context = section parameter_dict init-script-parameters
[update-mysql]
......@@ -155,34 +147,34 @@ recipe = slapos.cookbook:generic.mysql.wrap_update_mysql
output = ${directory:bin}/mariadb_update
binary = ${binary-wrap-mysql_upgrade:wrapper-path}
mysql = ${binary-wrap-mysql:wrapper-path}
init-script = ${init-script:rendered}
init-script = ${init-script:output}
mysql_tzinfo_to_sql = ${binary-wrap-mysql_tzinfo_to_sql:wrapper-path}
[{{ section('update-mysql-script') }}]
< = jinja2-template-script-base
rendered = ${directory:scripts}/mariadb_update
output = ${directory:scripts}/mariadb_update
init-password = ${directory:etc}/.init-passwd.done
upgrade-done = ${directory:lib}/mariadb-update-done
extra-context =
key init_password_done :init-password
key upgrade_done :upgrade-done
key init_root_sql init-root-sql:rendered
key init_root_sql init-root-sql:output
key mysql_update update-mysql:output
key init_database_sql init-script:rendered
template = {{ parameter_dict['template-init-root-wrapper'] }}
key init_database_sql init-script:output
url = {{ parameter_dict['template-init-root-wrapper'] }}
[{{ section('mysql-slave-db-cleanup') }}]
< = jinja2-template-script-base
rendered = ${directory:scripts}/manage-slave-db
output = ${directory:scripts}/manage-slave-db
db-name = {{ slapparameter_dict['database-name'] }}
extra-context =
key database_name :db-name
template = {{ parameter_dict['template-manage-db'] }}
url = {{ parameter_dict['template-manage-db'] }}
[mysqld]
< = jinja2-template-executable
rendered = ${directory:bin}/mysqld
template = {{ parameter_dict['template-mysqld-wrapper'] }}
recipe = slapos.recipe.template:jinja2
output = ${directory:bin}/mysqld
url = {{ parameter_dict['template-mysqld-wrapper'] }}
context =
key defaults_file install-mysql-config:config
key datadir my-cnf-parameters:data-directory
......@@ -197,7 +189,7 @@ environ =
[mysqld-launcher]
recipe = slapos.cookbook:wrapper
command-line = ${mysqld:rendered}
command-line = ${mysqld:output}
wrapper-path = ${directory:controller}/mariadb
wait-for-files =
${mysql-directory:mysql}/my.cnf
......@@ -234,15 +226,14 @@ link-binary = {{ dumps(parameter_dict['link-binary']) }}
# Note: --defaults-file must be the first argument, otherwise wrapped binary
# will reject it.
recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/${:command}
mode = 755
template =
inline:#!/bin/sh
output = ${directory:bin}/${:command}
inline =
#!/bin/sh
exec {{ parameter_dict['mariadb-location'] }}/bin/${:command} \
--defaults-file="${directory:etc}/mysql/my.cnf" \
--protocol=socket \
${:extra-args} "$@"
wrapper-path = ${:rendered}
wrapper-path = ${:output}
extra-args =
[binary-wrap-mysql]
......@@ -266,8 +257,8 @@ command = mysqladmin
<= binary-wrap-base
command-line = "{{ parameter_dict['mariadb-location'] }}/bin/${:command}" --skip-write-binlog
command = mysql_tzinfo_to_sql
template =
inline:#!/bin/sh
inline =
#!/bin/sh
exec {{ parameter_dict['mariadb-location'] }}/bin/${:command} \
--defaults-file="${directory:etc}/mysql/my.cnf" \
--skip-write-binlog "$@"
......@@ -313,7 +304,7 @@ tmp-dir = ${directory:tmp}
mysqld-socket = ${my-cnf-parameters:socket}
mysql-client = ${binary-wrap-mysql:wrapper-path}
socat-port = {{ int(port) + 9 }}
restart-script = ${mysqld-restart-script:rendered}
restart-script = ${mysqld-restart-script:output}
socat-location = {{ parameter_dict['socat-location'] }}
mysql-location = {{ parameter_dict['mariadb-location'] }}
gzip-location = {{ parameter_dict['gzip-location'] }}
......@@ -323,23 +314,24 @@ port = {{ port }}
use-ipv6 = {{ dumps(use_ipv6) }}
[dbjobs-executable]
< = jinja2-template-executable
rendered = ${directory:bin}/dbjobs
recipe = slapos.recipe.template:jinja2
output = ${directory:bin}/dbjobs
context =
section parameter_dict dbjob-parameter
template = {{ parameter_dict['dbjobs-template'] }}
url = {{ parameter_dict['dbjobs-template'] }}
[{{ section('dbjobs-cron-entry') }}]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = dbjobs
frequency = * * * * *
command = ${dbjobs-executable:rendered}
command = ${dbjobs-executable:output}
[mysqld-restart-script]
< = jinja2-template-executable
rendered = ${directory:bin}/mysqld_restart
template = inline:#!/bin/sh
recipe = slapos.recipe.template:jinja2
output = ${directory:bin}/mysqld_restart
inline =
#!/bin/sh
# This script is disabled on SlapOS
echo "RESTART FROM dbjbos WAS DISABLED"
......@@ -348,15 +340,15 @@ recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = mariadb-need-start
frequency = * * * * *
command = ${template-mysqld-need-start:rendered}
command = ${template-mysqld-need-start:output}
[template-mysqld-need-start]
< = jinja2-template-executable
rendered = ${directory:bin}/mysqld_need_start
template = {{ parameter_dict['template-mysqld-need-start'] }}
recipe = slapos.recipe.template:jinja2
output = ${directory:bin}/mysqld_need_start
url = {{ parameter_dict['template-mysqld-need-start'] }}
context =
key mariadb_controller mariadb-ctl-bin:wrapper-path
key update_config mysql-get-config:rendered
key update_config mysql-get-config:output
raw username {{ slapparameter_dict['repman-user'] }}
raw repman_url {{ slapparameter_dict['repman-url'] }}
raw jq_bin {{ jq_bin }}
......@@ -368,10 +360,11 @@ context =
# Donwnload mariadb configuration from repman
[mysql-get-config]
< = jinja2-template-executable
rendered = ${directory:bin}/mysqld-update-config
recipe = slapos.recipe.template:jinja2
output = ${directory:bin}/mysqld-update-config
cluster = {{ slapparameter_dict['cluster'] }}
template = inline:#!{{ bash_bin }}
inline =
#!{{ bash_bin }}
cd ${directory:config-tmp} &&
{{ curl_bin }} -o config.tar.gz {{ slapparameter_dict['repman-url'] }}/api/clusters/${:cluster}/servers/{{ host }}/{{ port }}/config
tar -xzf config.tar.gz
......@@ -379,13 +372,13 @@ template = inline:#!{{ bash_bin }}
cp -r data/.system ${mysql-directory:data}
cp -r etc/mysql/* ${mysql-directory:mysql}
ln -sf ${mysql-directory:data}/.system ${directory:var}/system
ln -sf ${my-cnf:rendered} ${mysql-directory:custom}/01_mariadb.cnf
ln -sf ${my-cnf:output} ${mysql-directory:custom}/01_mariadb.cnf
[{{ section('install-mysql-config') }}]
recipe = plone.recipe.command
stop-on-error = true
config = ${directory:etc}/mysql/my.cnf
command = ${mysql-get-config:rendered}
command = ${mysql-get-config:output}
update-command = ${:command}
[dash]
......
......@@ -72,7 +72,8 @@ config-caucase-url = {{ caucase_url }}
[download-proxy-config]
recipe = slapos.recipe.template:jinja2
template = inline:#!{{ bash_bin }}
inline =
#!{{ bash_bin }}
NAME=$1
HOST=$2
PORT=$3
......@@ -85,8 +86,7 @@ template = inline:#!{{ bash_bin }}
{{ curl_bin }} -o proxies-$NAME.tar.gz ${nginx-parameter:repman-url}/api/clusters/$NAME/servers/$HOST/$PORT/config
tar -xzf proxies-$NAME.tar.gz
cp etc/proxysql/proxysql.cnf $CONFIG
rendered = ${directory:bin}/update-proxysql-config
mode = 755
output = ${directory:bin}/update-proxysql-config
{% for instance_dict in slave_instance_list -%}
{% set slave_dict = {
......@@ -237,8 +237,8 @@ switchover-wait-write-query = {{ parameter_dict.get('switchover-wait-write-query
[{{ 'config-' ~ name }}]
recipe = slapos.recipe.template:jinja2
template = {{ config_cluster_toml_in }}
rendered = ${repman:clusters}/config-{{ name }}.toml
url = {{ config_cluster_toml_in }}
output = ${repman:clusters}/config-{{ name }}.toml
extra-context =
context =
section parameter_dict {{ name ~ '-cluster-parameter' }}
......@@ -252,7 +252,7 @@ config = ${proxysql-directory:config}/proxysql.cnf
data = ${repman:proxy-data}/{{ name }}
command =
mkdir -p ${:data} &&
${download-proxy-config:rendered} {{ name }} {{ ipv4 }} {{ '${' ~ name ~ '-cluster-parameter:proxy-admin-port}' }} ${:config}
${download-proxy-config:output} {{ name }} {{ ipv4 }} {{ '${' ~ name ~ '-cluster-parameter:proxy-admin-port}' }} ${:config}
update-command = ${:command}
[proxysql-{{ name }}-wrapper]
......@@ -308,14 +308,14 @@ config-port = {{ '${' ~ name ~ '-cluster-parameter:proxy-port}' }}
[{{ name}}-publish-slave-information]
recipe = slapos.cookbook:switch-softwaretype
default = {{ 'dynamic-' ~name ~ '-publish-slave-information:rendered' }}
default = {{ 'dynamic-' ~name ~ '-publish-slave-information:output' }}
RootSoftwareInstance = ${:default}
[dynamic-{{ name}}-publish-slave-information]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/database-publish-slave-information.cfg
output = ${buildout:directory}/database-publish-slave-information.cfg
extensions = jinja2.ext.do
template = {{ template_publish_slave_information }}
url = {{ template_publish_slave_information }}
context =
import json_module json
key proxy_port {{ name }}-cluster-parameter:proxy-port
......@@ -404,10 +404,9 @@ context =
[caucase-sign-csr]
recipe = slapos.recipe.template:jinja2
mode = 755
rendered = ${directory:bin}/caucase-sign
template =
inline:#!/bin/sh
output = ${directory:bin}/caucase-sign
inline =
#!/bin/sh
cp ${directory:ssl}/caucase.user.key ${directory:ssl}/caucase-full.key
cat ${directory:ssl}/caucase.user.crt >> ${directory:ssl}/caucase-full.key
for csr_id in {{ csrid_list | join(' ') }}; do
......@@ -422,7 +421,7 @@ recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = caucase-sign-csr
frequency = * * * * *
command = ${caucase-sign-csr:rendered}
command = ${caucase-sign-csr:output}
{% do part_list.append('cron-caucase-sign-csr') -%}
[slap-configuration]
......@@ -520,7 +519,7 @@ update-command = ${:command}
[replication-manager-reload]
recipe = slapos.recipe.template:jinja2
template = {{ template_repman_manager_sh }}
url = {{ template_repman_manager_sh }}
cluster-list = {{ dumps( list(slapparameter_dict.get('repman-cluster-dict', default_parameter_dict)) ) }}
context =
section parameter_dict repman
......@@ -531,8 +530,7 @@ context =
raw jq_bin {{ jq_bin }}
raw curl_bin {{ curl_bin }}
raw bash_bin {{ bash_bin }}
rendered = ${directory:scripts}/repman-reload
mode = 755
output = ${directory:scripts}/repman-reload
[replication-manager]
recipe = slapos.cookbook:wrapper
......@@ -542,7 +540,7 @@ command-line =
--monitoring-sharedir=${repman-parameter:share-dir}
--http-root=${repman-parameter:http-root}
--monitoring-datadir=${repman:data-dir}
--config=${repman-config.toml:rendered}
--config=${repman-config.toml:output}
--log-file=${repman-parameter:log}
--memprofile=${directory:tmp}/repmgr.mprof
monitor
......@@ -560,8 +558,8 @@ wait-for-files =
[repman-config.toml]
recipe = slapos.recipe.template:jinja2
template = {{ config_toml_in }}
rendered = ${repman:etc}/config.toml
url = {{ config_toml_in }}
output = ${repman:etc}/config.toml
extra-context =
context =
section parameter_dict repman-parameter
......@@ -582,8 +580,8 @@ config-port = ${repman-parameter:secure-port}
[nginx-conf]
recipe = slapos.recipe.template:jinja2
template = {{ nginx_conf_in }}
rendered = ${nginx-parameter:config-file}
url = {{ nginx_conf_in }}
output = ${nginx-parameter:config-file}
context =
section parameter_dict nginx-parameter
......@@ -592,7 +590,7 @@ recipe = slapos.cookbook:wrapper
command-line =
{{ nginx_bin }}
-p ${directory:nginx-prefix}
-c ${nginx-conf:rendered}
-c ${nginx-conf:output}
wrapper-path = ${directory:services}/nginx
wait-for-files =
${directory:ssl}/repman-cert.crt
......@@ -601,12 +599,11 @@ wait-for-files =
[nginx-graceful-wrapper]
recipe = slapos.recipe.template:jinja2
template = inline:#!{{ bash_bin }}
recipe = slapos.recipe.template
inline =
#!{{ bash_bin }}
kill -USR1 "$(cat ${nginx-parameter:pid-file})"
rendered = ${directory:scripts}/nginx-graceful
context =
mode = 755
output = ${directory:scripts}/nginx-graceful
[logrotate-entry-nginx]
<= logrotate-entry-base
......@@ -637,7 +634,7 @@ database-list = {{ db_list }}
[monitor-instance-parameter]
monitor-httpd-port = 8060
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.app.officejs.com') }}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.app.officejs.com') }}
username = admin
password = ${publish-early:monitor-password}
......@@ -674,14 +671,13 @@ config-url = ${nginx-parameter:backend-ssl-url}
[template-proxysql-need-stop-start]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/proxysql_check_stop_start
template = {{ template_proxy_need_stopstart }}
mode = 755
output = ${directory:bin}/proxysql_check_stop_start
url = {{ template_proxy_need_stopstart }}
cluster-list = !py![{{ cluster_list | join(', ') }}]
context =
key proxysql_controller {{proxysql_controller}}-bin:wrapper-path
key repman_url nginx-parameter:backend-url
key get_proxy_config download-proxy-config:rendered
key get_proxy_config download-proxy-config:output
key cluster_list :cluster-list
raw jq_bin {{ jq_bin }}
raw bash_bin {{ bash_bin }}
......@@ -692,7 +688,7 @@ recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = proxysql-need-stop-start
frequency = * * * * *
command = ${template-proxysql-need-stop-start:rendered}
command = ${template-proxysql-need-stop-start:output}
#############################
#
......
......@@ -8,9 +8,9 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = template-instance-repman.cfg:rendered
default = template-instance-repman.cfg:output
RootSoftwareInstance = ${:default}
mariadb = template-instance-mariadb.cfg:rendered
mariadb = template-instance-mariadb.cfg:output
[slap-configuration]
......@@ -24,9 +24,8 @@ cert = ${slap-connection:cert-file}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
mode = 0644
extensions = jinja2.ext.do
rendered= ${buildout:directory}/${:_buildout_section_name_}
output= ${buildout:directory}/${:_buildout_section_name_}
supervisord-lib = {{ supervisord_lib }}
causace-lib = {{ caucase_library }}
import-list =
......@@ -58,7 +57,7 @@ extra-context =
[template-instance-repman.cfg]
<= jinja2-template-base
template= {{ template_repman_cfg }}
url = {{ template_repman_cfg }}
extra-context =
key slave_instance_list slap-configuration:slave-instance-list
raw gowork_bin {{ gowork_bin }}
......@@ -104,7 +103,7 @@ groonga-plugins-path = {{ groonga_plugin_dir }}:{{ groonga_mysql_normalizer_plug
[template-instance-mariadb.cfg]
<= jinja2-template-base
template = {{ template_mariadb }}
url = {{ template_mariadb }}
filename = instance-mariadb.cfg
extra-context =
section parameter_dict template-mariadb-parameters
......@@ -39,11 +39,10 @@ location = ${mariadb-10.4:location}
part = python3
[template-mysqld-wrapper]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/mysqld.in
mode = 644
template =
inline:{% raw %}#!/bin/sh -e
recipe = slapos.recipe.template
output = ${buildout:parts-directory}/${:_buildout_section_name_}/mysqld.in
inline =
#!/bin/sh -e
basedir='${mariadb:location}'
datadir='{{datadir}}'
marker=$datadir/.slapos_initializing
......@@ -65,13 +64,11 @@ template =
{%- endfor %}
{%- endif %}
exec "$basedir/bin/mysqld" --defaults-file='{{defaults_file}}' "$@"
{% endraw %}
[instance.cfg]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/instance.cfg
template = ${:_profile_base_location_}/${:filename}
mode = 0644
output = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
context =
key bash_location bash:location
key bin_directory buildout:bin-directory
......@@ -87,11 +84,11 @@ context =
key dbjobs_in dbjobs-in:target
key dash_location dash:location
key jq_location jq:location
key logrotate_cfg template-logrotate-base:rendered
key logrotate_cfg template-logrotate-base:output
key gowork_bin gowork:bin
key gzip_location gzip:location
key haproxy_location haproxy:location
key template_monitor monitor2-template:rendered
key template_monitor monitor2-template:output
key mariadb_link_binary template-mariadb.cfg:link-binary
key mariadb_location mariadb:location
key mysqld_start_template mysqld-need-start.sh.in:target
......@@ -113,9 +110,9 @@ context =
key template_repman_manager_sh repman-manager-sh.in:target
key template_mariadb template-mariadb.cfg:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_monitor_cfg monitor2-template:rendered
key template_monitor_cfg monitor2-template:output
key template_my_cnf template-my-cnf:target
key template_mysqld_wrapper template-mysqld-wrapper:rendered
key template_mysqld_wrapper template-mysqld-wrapper:output
key template_init_root_sql mariadb-init-root-sql:target
key template_init_root_wrapper init-root-wrapper-in:target
key template_repman_cfg instance-repman.cfg:target
......
......@@ -15,4 +15,4 @@
[instance.cfg.in]
filename = instance.cfg.in
md5sum = 0bd2594778cc5f29abfee7cd015c1e7d
md5sum = a5a05e6949d78882bde4d53fb21cdd00
......@@ -77,9 +77,8 @@ caucase.updater(
)}}
[rest-server-certificate-csr-config]
recipe = slapos.recipe.template:jinja2
mode = 644
template = inline:
recipe = slapos.recipe.template
inline =
[req]
prompt = no
req_extensions = req_ext
......@@ -92,7 +91,7 @@ template = inline:
IP.1 = ${instance-parameter:ipv4-random}
IP.2 = ${instance-parameter:ipv6-random}
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:_buildout_section_name_}.txt
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:_buildout_section_name_}.txt
[rest-server-certificate-prepare-csr]
recipe = plone.recipe.command
......@@ -104,7 +103,7 @@ command =
-new \
-nodes \
-keyout /dev/null \
-config '${rest-server-certificate-csr-config:rendered}' \
-config '${rest-server-certificate-csr-config:output}' \
-out '${:csr}'
fi
stop-on-error = true
......@@ -136,7 +135,7 @@ user = backup
[rest-server-htpassword]
recipe = plone.recipe.command
command =
command =
if [ ! -f '${:htpassword}' ] ; then
{{ htpasswd_bin }} \
-b \
......
......@@ -32,9 +32,8 @@ revision = v0.10.0-0-g9313f19
[instance.cfg.in]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/instance.cfg
template = ${:_profile_base_location_}/${:filename}
mode = 0644
output = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
context =
section buildout buildout
key gowork_bin gowork:bin
......@@ -42,6 +41,6 @@ context =
raw htpasswd_bin ${apache:location}/bin/htpasswd
raw dash_bin ${dash:location}/bin/dash
raw curl_bin ${curl:location}/bin/curl
key template_monitor monitor2-template:rendered
key template_monitor monitor2-template:output
import-list =
file caucase caucase-jinja2-library:target
......@@ -48,7 +48,6 @@ post-install =
[macro-template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
mode = 0644
[template]
<= macro-template
......
......@@ -15,8 +15,8 @@
[template]
filename = instance.cfg.in
md5sum = 0084214fae4ee1aad2c878aa393757af
md5sum = 9b41238f67ea8e12f8ea9590fd552b33
[template-selenium]
filename = instance-selenium.cfg.in
md5sum = 35ba19f7cb4fe7fc9469611f2446c94e
md5sum = 3e50d629307ca9f1381909102a52756d
......@@ -4,15 +4,15 @@ parts =
promises
publish-connection-parameter
extends = ${monitor-template:rendered}
extends = ${monitor-template:output}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[fontconfig-conf]
recipe = slapos.recipe.template:jinja2
template = ${template-fonts-conf:output}
rendered = $${directory:etc}/fonts.conf
url = ${template-fonts-conf:output}
output = $${directory:etc}/fonts.conf
context =
key cachedir directory:fontconfig-cache
key fonts :fonts
......@@ -93,7 +93,7 @@ environment =
PATH=${buildout:bin-directory}
XORG_LOCK_DIR=$${directory:tmp}
DISPLAY=$${xvfb-instance:display}
FONTCONFIG_FILE=$${fontconfig-conf:rendered}
FONTCONFIG_FILE=$${fontconfig-conf:output}
hostname = $${slap-configuration:ipv4-random}
......@@ -146,9 +146,9 @@ bytes = 12
[selenium-server-frontend-config]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/$${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = $${directory:etc}/$${:_buildout_section_name_}
inline =
https://[$${:ip}]:$${:port} {
bind $${:ip}
tls self_signed # TODO
......@@ -175,7 +175,7 @@ path-hub = /wd/hub
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line =
${caddy:output} -conf $${selenium-server-frontend-config:rendered}
${caddy:output} -conf $${selenium-server-frontend-config:output}
ip = $${selenium-server-frontend-config:ip}
hostname = $${selenium-server-frontend-config:hostname}
......@@ -229,10 +229,10 @@ command = echo "$${:fingerprint}" | ( grep ^Error || exit 0 && exit 1 )
fingerprint = $${ssh-key-fingerprint-shelloutput:fingerprint}
[sshd-config]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/sshd.conf
recipe = slapos.recipe.template
output = $${directory:etc}/sshd.conf
path_pid = $${directory:run}/sshd.pid
template = inline:
inline =
PidFile $${:path_pid}
Port $${sshd-address:port}
ListenAddress $${sshd-address:ip}
......@@ -250,7 +250,7 @@ template = inline:
[sshd-service]
recipe = slapos.cookbook:wrapper
command-line = ${openssh:location}/sbin/sshd -D -e -f $${sshd-config:rendered}
command-line = ${openssh:location}/sbin/sshd -D -e -f $${sshd-config:output}
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
username = $${userinfo:pw-name}
ip = $${sshd-address:ip}
......@@ -307,16 +307,14 @@ config-port = $${selenium-server-hub-instance:port}
promise = check_command_execute
name = $${:_buildout_section_name_}.py
config-command =
$${selenium-server-check-nodes-registered:rendered} $${selenium-server-hub-instance:api-url} $${:expected-node-count}
$${selenium-server-check-nodes-registered:output} $${selenium-server-hub-instance:api-url} $${:expected-node-count}
# We have 6 nodes with 3 slots each
expected-node-count = 18
[selenium-server-check-nodes-registered]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0755
template =
inline:
recipe = slapos.recipe.template
output = $${directory:bin}/$${:_buildout_section_name_}
inline =
#!${buildout:executable}
import json, urllib, sys
api_url = sys.argv[1]
......
......@@ -8,8 +8,8 @@ offline = true
[dynamic-template-selenium]
recipe = slapos.recipe.template:jinja2
template = ${template-selenium:output}
rendered = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filename}
url = ${template-selenium:output}
output = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filename}
filename = instance-selenium.cfg
context =
key partition_ipv6 slap-configuration:ipv6-random
......@@ -17,7 +17,7 @@ context =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = $${:default}
default = dynamic-template-selenium:rendered
default = dynamic-template-selenium:output
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
......
......@@ -36,7 +36,6 @@ url = https://selenium-release.storage.googleapis.com/3.14/${:filename}
[macro-template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
mode = 0644
[template]
<= macro-template
......
......@@ -18,7 +18,7 @@ md5sum = ce9c231ec47eb8f528345add21cb7822
[template-balancer]
filename = instance-balancer.cfg.in
md5sum = f565956476c31881b6e51ae1c27793ad
md5sum = 95ac13b95bc9d5356fffe9c62dec38cc
[template-apache-backend-conf]
filename = apache-backend.conf.in
......
......@@ -17,7 +17,6 @@ per partition. No more (undefined result), no less (IndexError).
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
mode = 644
{{ caucase.updater(
prefix='caucase-updater',
......@@ -104,16 +103,16 @@ ip = {{ ipv4 }}
[haproxy-cfg]
< = jinja2-template-base
template = {{ parameter_dict['template-haproxy-cfg'] }}
rendered = ${directory:etc}/haproxy.cfg
url = {{ parameter_dict['template-haproxy-cfg'] }}
output = ${directory:etc}/haproxy.cfg
context = section parameter_dict haproxy-cfg-parameter-dict
extensions = jinja2.ext.do
[{{ section('haproxy') }}]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/haproxy
command-line = "{{ parameter_dict['haproxy'] }}/sbin/haproxy" -f "${haproxy-cfg:rendered}"
hash-files = ${haproxy-cfg:rendered}
command-line = "{{ parameter_dict['haproxy'] }}/sbin/haproxy" -f "${haproxy-cfg:output}"
hash-files = ${haproxy-cfg:output}
[apache-conf-ssl]
cert = ${directory:apache-conf}/apache.crt
......@@ -126,7 +125,7 @@ crl = ${directory:apache-conf}/crl.pem
[simplefile]
< = jinja2-template-base
template = inline:{{ '{{ content }}' }}
inline ={{ '{{ content }}' }}
{% macro simplefile(section_name, file_path, content, mode='') -%}
{% set content_section_name = section_name ~ '-content' -%}
......@@ -135,7 +134,7 @@ content = {{ dumps(content) }}
[{{ section(section_name) }}]
< = simplefile
rendered = {{ file_path }}
output = {{ file_path }}
context = key content {{content_section_name}}:content
mode = {{ mode }}
{%- endmacro %}
......@@ -143,8 +142,8 @@ mode = {{ mode }}
[apache-ssl]
{% if ssl_parameter_dict.get('key') -%}
key = ${apache-ssl-key:rendered}
cert = ${apache-ssl-cert:rendered}
key = ${apache-ssl-key:output}
cert = ${apache-ssl-cert:output}
{{ simplefile('apache-ssl-key', '${apache-conf-ssl:key}', ssl_parameter_dict['key']) }}
{{ simplefile('apache-ssl-cert', '${apache-conf-ssl:cert}', ssl_parameter_dict['cert']) }}
{% else %}
......@@ -175,19 +174,19 @@ crl = ${apache-conf-ssl:crl}
{% if shared_ca_path -%}
shared-ca-cert = {{ shared_ca_path }}/cacert.pem
shared-crl = {{ shared_ca_path }}/crl
shared-crl = {{ shared_ca_path }}/crl
{%- endif %}
[apache-conf]
< = jinja2-template-base
template = {{ parameter_dict['template-apache-conf'] }}
rendered = ${directory:apache-conf}/apache.conf
url = {{ parameter_dict['template-apache-conf'] }}
output = ${directory:apache-conf}/apache.conf
context = section parameter_dict apache-conf-parameter-dict
[{{ section('apache') }}]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/apache
command-line = "{{ parameter_dict['apache'] }}/bin/httpd" -f "${apache-conf:rendered}" -DFOREGROUND
command-line = "{{ parameter_dict['apache'] }}/bin/httpd" -f "${apache-conf:output}" -DFOREGROUND
wait-for-files =
${apache-conf-ssl:cert}
${apache-conf-ssl:key}
......@@ -262,8 +261,8 @@ apachedex = ${monitor-directory:private}/apachedex
[{{ section('resiliency-exclude-file') }}]
# Generate rdiff exclude file in case of resiliency
< = jinja2-template-base
template = {{ 'inline:{{ "${directory:log}/**\\n" }}' }}
rendered = ${directory:srv}/exporter.exclude
inline = {{ '{{ "${directory:log}/**\\n" }}' }}
output = ${directory:srv}/exporter.exclude
[{{ section('monitor-generate-apachedex-report') }}]
recipe = slapos.cookbook:cron.d
......@@ -281,9 +280,9 @@ command-line = "{{ parameter_dict['run-apachedex-location'] }}" "{{ parameter_di
command = generate-apachedex-report
[monitor-apachedex-report-config]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = ${directory:etc}/${:_buildout_section_name_}
inline =
{% for line in slapparameter_dict['apachedex-configuration'] %}
{# apachedex config files use shlex.split, so we need to quote the arguments. #}
{# BBB: in python 3 we can use shlex.quote instead. #}
......@@ -292,7 +291,7 @@ template = inline:
[apachedex-parameters]
apache-log-list = ${apache-conf-parameter-dict:access-log}
configuration = ${monitor-apachedex-report-config:rendered}
configuration = ${monitor-apachedex-report-config:output}
promise-threshold = {{ slapparameter_dict['apachedex-promise-threshold'] }}
[{{ section('monitor-promise-apachedex-result') }}]
......
......@@ -15,4 +15,4 @@
[template]
filename = instance.cfg
md5sum = 2c8b202b0c366e27dd6e6f456fb18256
md5sum = 06379c0ed1fe0df409c7b8f61fc218eb
......@@ -28,9 +28,9 @@ test-working-dir = ${buildout:directory}/tmp
nxdtest-working-dir = ${:var}/nxdtest
[slapos-test-runner-nxdtest-environment.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = ${directory:etc}/${:_buildout_section_name_}
inline =
export PATH={{ buildout['bin-directory'] }}:{{ curl_location }}/bin:{{ faketime_location }}/bin:{{ openssl_location }}/bin:/usr/bin:/bin
export SLAPOS_TEST_IPV4=${slap-configuration:ipv4-random}
export SLAPOS_TEST_IPV6=${slap-configuration:ipv6-random}
......@@ -38,11 +38,11 @@ template = inline:
[slapos-test-runner-dot-nxdtest]
recipe = slapos.recipe.template:jinja2
rendered = ${:workdir}/.nxdtest
output = ${:workdir}/.nxdtest
workdir = ${directory:nxdtest-working-dir}
tests = {{ tests | indent(2) }}
template =
inline:{% raw %}
inline =
{% raw %}
{%- set only_sr = slapparameter_dict.get('only-sr') %}
{%- if only_sr and not isinstance(only_sr, list) %}
{%- set only_sr = [only_sr] %}
......@@ -70,14 +70,14 @@ context =
raw interpreter {{ interpreter }}
[runTestSuite]
env.sh = ${slapos-test-runner-nxdtest-environment.sh:rendered}
env.sh = ${slapos-test-runner-nxdtest-environment.sh:output}
workdir = ${slapos-test-runner-dot-nxdtest:workdir}
[slapos-local-development-environment.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/${:_buildout_section_name_}
template = inline:
source ${slapos-test-runner-nxdtest-environment.sh:rendered}
recipe = slapos.recipe.template
output = ${directory:etc}/${:_buildout_section_name_}
inline =
source ${slapos-test-runner-nxdtest-environment.sh:output}
{% set shared_part_list = [] %}
{% for shared_part in buildout['shared-part-list'].splitlines() -%}
{% do shared_part_list.append(shared_part) %}
......@@ -92,4 +92,4 @@ template = inline:
[publish]
recipe = slapos.cookbook:publish
environment-script = ${slapos-local-development-environment.sh:rendered}
environment-script = ${slapos-local-development-environment.sh:output}
......@@ -326,14 +326,13 @@ branch = master
[template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
url = ${:_profile_base_location_}/${:filename}
extensions = jinja2.ext.do
rendered = ${buildout:directory}/template.cfg
mode = 640
output = ${buildout:directory}/template.cfg
context =
section buildout buildout
import os os
key nxdtest_instance nxdtest-instance.cfg:rendered
key nxdtest_instance nxdtest-instance.cfg:output
key git_location git:location
key slapos_location slapos-repository:location
key interpreter python-interpreter:interpreter
......
......@@ -15,4 +15,4 @@
[template]
filename = instance.cfg
md5sum = ba6c572678687081ce111d3805be3cee
md5sum = 850dedff7af48a70208361cabf688724
[buildout]
extends = ${nxdtest-instance.cfg:rendered}
extends = ${nxdtest-instance.cfg:output}
parts +=
publish
......@@ -33,14 +33,15 @@ repository = ${kedifa-repository:location}
repository = ${caucase-repository:location}
[caucase-test-runner]
recipe = slapos.recipe.template:jinja2
template = inline:#!/bin/sh
recipe = slapos.recipe.template
inline =
#!/bin/sh
export HOSTS_FILE="$(mktemp)"
trap 'rm "$HOSTS_FILE"' EXIT
printf '%s testhost\n%s testhost\n' "$SLAPOS_TEST_IPV4" "$SLAPOS_TEST_IPV6" > "$HOSTS_FILE"
export CAUCASE_NETLOC=testhost:8000 LD_PRELOAD=${userhosts:location}/lib/libuserhosts.so:$LD_PRELOAD
exec python -m unittest discover -v
rendered = $${caucase:location}/host_setting.sh
output = $${caucase:location}/host_setting.sh
[slapos.libnetworkcache]
<= download-source
......@@ -84,9 +85,9 @@ repository = ${rubygemsrecipe-repository:location}
[slapos-test-runner-nxdtest-environment.sh]
recipe = slapos.recipe.template:jinja2
rendered = $${create-directory:etc}/$${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = $${create-directory:etc}/$${:_buildout_section_name_}
inline =
export PATH=${coreutils:location}/bin:${curl:location}/bin:${openssl:location}/bin:${jq:location}/bin:${sed:location}/bin:${grep:location}/bin:${git:location}/bin:${libxslt:location}/bin:${socat:location}/bin:${lmsensors:location}/bin:${rsync:location}/bin/:${buildout:bin-directory}:$PATH
export SLAPOS_TEST_IPV4=$${slap-configuration:ipv4-random}
export SLAPOS_TEST_IPV6=$${slap-configuration:ipv6-random}
......@@ -96,11 +97,10 @@ template = inline:
[slapos-test-runner-dot-nxdtest]
recipe = slapos.recipe.template:jinja2
rendered = $${:workdir}/.nxdtest
recipe = slapos.recipe.template
output = $${:workdir}/.nxdtest
workdir = $${create-directory:nxdtest-working-dir}
template = inline:
inline =
TestCase(
"kedifa",
['python', '-m', 'unittest', 'discover', '-v'],
......@@ -109,7 +109,7 @@ template = inline:
)
TestCase(
"caucase",
['$${caucase-test-runner:rendered}'],
['$${caucase-test-runner:output}'],
cwd="""$${caucase:location}""",
summaryf=UnitTest.summary,
)
......@@ -191,14 +191,14 @@ template = inline:
)
[runTestSuite]
env.sh = $${slapos-test-runner-nxdtest-environment.sh:rendered}
env.sh = $${slapos-test-runner-nxdtest-environment.sh:output}
workdir = $${slapos-test-runner-dot-nxdtest:workdir}
[slapos-local-development-environment.sh]
recipe = slapos.recipe.template:jinja2
rendered = $${create-directory:etc}/$${:_buildout_section_name_}
template = inline:
source $${slapos-test-runner-nxdtest-environment.sh:rendered}
recipe = slapos.recipe.template
output = $${create-directory:etc}/$${:_buildout_section_name_}
inline =
source $${slapos-test-runner-nxdtest-environment.sh:output}
echo "Environment loaded."
echo "To work on a test, execute:"
echo " $${runTestSuite:wrapper-path} -k test_name"
......@@ -207,4 +207,4 @@ template = inline:
[publish]
recipe = slapos.cookbook:publish
environment-script = $${slapos-local-development-environment.sh:rendered}
environment-script = $${slapos-local-development-environment.sh:output}
......@@ -209,7 +209,6 @@ repository = https://lab.nexedi.com/nexedi/rubygemsrecipe.git
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 640
[versions]
# When possible, clear version pins of tested eggs, to make sure buildout
......
......@@ -14,11 +14,11 @@
# not need these here).
[template]
filename = instance.cfg
md5sum = ba3539d959143a3be76fcb54196a3aa8
md5sum = 473325442cba8ee32642d1e5e3fa94f4
[template-runner]
filename = instance-runner.cfg
md5sum = efa0d1647dee2689485264daf256c76d
md5sum = 8d284c9257250afd83a1463662a56d08
[template-runner-import-script]
filename = template/runner-import.sh.jinja2
......@@ -26,11 +26,11 @@ md5sum = f2e2493bc5da90a53f86e5bcf64d2d57
[instance-runner-import]
filename = instance-runner-import.cfg.in
md5sum = a4ebf6918a2c68c02898b2142357f490
md5sum = f4d71d97cf16ef379b41c4c22352727c
[instance-runner-export]
filename = instance-runner-export.cfg.in
md5sum = b992bb3391de9d6d422bfa8011d8ffc4
md5sum = 5f57249108e61976d97465624cc5a2a1
[template-resilient]
filename = instance-resilient.cfg.jinja2
......
......@@ -86,9 +86,8 @@ private-path-list +=
[monitor-check-resilient-feed-file]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_check_resilient_feed_template_path }}
rendered = ${monitor-directory:bin}/check-create-resilient-feed-files
mode = 700
url = {{ monitor_check_resilient_feed_template_path }}
output = ${monitor-directory:bin}/check-create-resilient-feed-files
context =
key input_feed_directory directory:notifier-feeds
key monitor_feed_directory monitor-directory:public
......
......@@ -79,11 +79,10 @@ recipe =
[importer]
recipe = slapos.recipe.template:jinja2
template = {{ importer_script_path }}
rendered = ${directory:bin}/${slap-parameter:namebase}-importer
url = {{ importer_script_path }}
output = ${directory:bin}/${slap-parameter:namebase}-importer
# backward compatibility for resilient stack
wrapper = ${:rendered}
mode = 700
wrapper = ${:output}
restore-exit-code-file = ${directory:srv}/${:restore-exit-code-file-basename}
restore-exit-code-file-basename = importer-exit-code-file
restore-error-message-file = ${directory:srv}/${:restore-error-message-file-basename}
......@@ -167,7 +166,6 @@ recipe = slapos.recipe.template
url = {{ software_release_information_template }}
output = ${directory:cgi-bin}/resilient_software_release_information.py
resilient-log-url = ${monitor-publish-parameters:monitor-base-url}/log/${importer:resilient-log-basename}
mode = 0600
[slap-parameter]
auto-deploy-instance = false
......
......@@ -53,8 +53,8 @@ common-runner-parts =
parts = $${:common-runner-parts}
extends =
${monitor2-template:rendered}
${template-logrotate-base:rendered}
${monitor2-template:output}
${template-logrotate-base:output}
[slap-network-information]
local-ipv4 = $${slap-configuration:ipv4-random}
......@@ -95,13 +95,13 @@ config-http-code = 401
{% endif -%}
[custom-frontend-url-ready-promise-bin]
recipe = slapos.recipe.template:jinja2
url = https://$${request-custom-frontend:connection-domain}
rendered = $${directory:bin}/custom_frontend_ready_promise
template = inline:
recipe = slapos.recipe.template
frontend-url = https://$${request-custom-frontend:connection-domain}
output = $${directory:bin}/custom_frontend_ready_promise
inline =
#!{{ dash_executable_location }}
URL="$${:url}"
URL="$${:frontend-url}"
CODE=$({{ curl_executable_location }} -g -k -sL $URL -w %{http_code} --max-time 5 -o /dev/null)
if [ $? -eq 3 ]; then
......@@ -113,10 +113,10 @@ template = inline:
<= monitor-promise-base
promise = check_command_execute
name = custom_frontend_ready_promise.py
config-command = $${custom-frontend-url-ready-promise-bin:rendered}
config-command = $${custom-frontend-url-ready-promise-bin:output}
[publish-connection-information]
custom-frontend-url = $${custom-frontend-url-ready-promise-bin:url}
custom-frontend-url = $${custom-frontend-url-ready-promise-bin:frontend-url}
{% endif %}
# Create all needed directories
......@@ -244,7 +244,7 @@ arguments = --server_url=$${slap-connection:server-url} --key_file=$${slap-conne
command-line = ${buildout:bin-directory}/slaprunnertest $${:arguments}
wrapper-path = $${directory:bin}/runTestSuite
environment = PATH=$${shell-environment:path}
RUNNER_CONFIG=$${slapos-cfg:rendered}
RUNNER_CONFIG=$${slapos-cfg:output}
# Deploy openssh-server
[runner-sshd-port]
......@@ -255,9 +255,9 @@ ip = $${slap-network-information:global-ipv6}
[runner-sshd-config]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/runner-sshd.conf
output = $${directory:etc}/runner-sshd.conf
path_pid = $${directory:run}/runner-sshd.pid
template = inline:
inline =
PidFile $${:path_pid}
Port $${runner-sshd-port:port}
ListenAddress $${slap-network-information:global-ipv6}
......@@ -272,7 +272,7 @@ template = inline:
[runner-sshd-service]
recipe = slapos.cookbook:wrapper
command-line = ${openssh:location}/sbin/sshd -D -e -f $${runner-sshd-config:rendered}
command-line = ${openssh:location}/sbin/sshd -D -e -f $${runner-sshd-config:output}
hash-existing-files = $${buildout:directory}/software_release/buildout.cfg
wrapper-path = $${directory:services}/runner-sshd
......@@ -362,8 +362,8 @@ work_dir = $${slaprunner:working-directory}
[nginx_conf]
recipe = slapos.recipe.template:jinja2
template = ${template_nginx_conf:target}
rendered = $${nginx-frontend:path_nginx_conf}
url = ${template_nginx_conf:target}
output = $${nginx-frontend:path_nginx_conf}
context =
key shellinabox_socket shellinabox:socket
key socket gunicorn:socket
......@@ -372,9 +372,8 @@ context =
[nginx-launcher]
recipe = slapos.recipe.template:jinja2
template = ${template_launcher:target}
rendered = $${nginx-frontend:bin_launcher}
mode = 700
url = ${template_launcher:target}
output = $${nginx-frontend:bin_launcher}
context =
section param_nginx_frontend nginx-frontend
......@@ -404,8 +403,8 @@ httpd_cors_file = $${slaprunner-httpd-cors:location}
[httpd-conf]
recipe = slapos.recipe.template:jinja2
template = ${template_httpd_conf:target}
rendered = $${directory:etc}/httpd.conf
url = ${template_httpd_conf:target}
output = $${directory:etc}/httpd.conf
context =
section parameters httpd-parameters
......@@ -413,7 +412,7 @@ context =
recipe = slapos.cookbook:wrapper
apache-executable = ${apache:location}/bin/httpd
wrapper-path = $${directory:services}/slaprunner-httpd
command-line = $${:apache-executable} -f $${httpd-conf:rendered} -DFOREGROUND
command-line = $${:apache-executable} -f $${httpd-conf:output} -DFOREGROUND
access-url = https://[$${httpd-parameters:global_ip}]:$${httpd-parameters:global_port}
wait-for-files =
$${ca-nginx:cert-file}
......@@ -502,7 +501,7 @@ crl = $${directory:ca-dir}/crl/
recipe = slapos.cookbook:certificate_authority.request
key-file = $${cadirectory:certs}/nginx_frontend.key
cert-file = $${cadirectory:certs}/nginx_frontend.crt
executable = $${nginx-launcher:rendered}
executable = $${nginx-launcher:output}
wrapper = $${directory:bin}/nginx-frontend
# Put domain name
name = example.com
......@@ -663,9 +662,8 @@ buildout-shared-folder = $${runnerdirectory:home}/shared
[slapos-cfg]
recipe = slapos.recipe.template:jinja2
template = ${template-slapos-cfg:target}
rendered = $${slaprunner:slapos.cfg}
mode = 700
url = ${template-slapos-cfg:target}
output = $${slaprunner:slapos.cfg}
context =
section slaprunner slaprunner
import codecs codecs
......@@ -673,17 +671,15 @@ context =
[slapos-test-cfg]
recipe = slapos.recipe.template:jinja2
template = ${template-slapos-cfg:target}
rendered = $${test-runner:slapos.cfg}
mode = 700
url = ${template-slapos-cfg:target}
output = $${test-runner:slapos.cfg}
context =
section slaprunner test-runner
[slapformat-definition.cfg]
recipe = slapos.recipe.template:jinja2
template = ${template-slapformat-definition.cfg:target}
rendered = $${slaprunner:slapformat-definition.cfg}
mode = 700
url = ${template-slapformat-definition.cfg:target}
output = $${slaprunner:slapformat-definition.cfg}
context =
section slaprunner slaprunner
key partition_user user-info:pw-name
......@@ -691,12 +687,11 @@ context =
raw buildout_shared_part_list_dump $${slaprunner:buildout-shared-part-list-dump}
[shellinabox]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template
# We cannot use slapos.cookbook:wrapper here because this recipe escapes too much
socket = $${directory:run}/siab.sock
mode = 0700
rendered = $${directory:bin}/shellinaboxd
template = inline:
output = $${directory:bin}/shellinaboxd
inline =
#!/bin/sh
exec ${shellinabox:location}/bin/shellinaboxd \
--unixdomain-only=$${:socket}:$(id -u):$(id -g):0600 \
......@@ -704,7 +699,7 @@ template = inline:
[shellinabox-service]
recipe = slapos.cookbook:wrapper
command-line = $${shellinabox:rendered}
command-line = $${shellinabox:output}
wrapper-path = $${directory:services}/shellinaboxd
hash-existing-files = $${buildout:directory}/software_release/buildout.cfg
......@@ -727,9 +722,8 @@ command = $${prepare-software:wrapper-path}
[instance-parameters]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
template = ${template-parameters:target}
rendered = $${directory:etc}/.parameter.xml.default
mode = 0644
url = ${template-parameters:target}
output = $${directory:etc}/.parameter.xml.default
context =
key slapparameter_dict slap-configuration:configuration
......@@ -737,7 +731,7 @@ context =
recipe = plone.recipe.command
stop-on-error = true
parameter-xml = $${directory:etc}/.parameter.xml
command = if [ ! -f $${:parameter-xml} ]; then cp $${instance-parameters:rendered} $${:parameter-xml}; fi
command = if [ ! -f $${:parameter-xml} ]; then cp $${instance-parameters:output} $${:parameter-xml}; fi
[instance-software-type]
recipe = plone.recipe.command
......@@ -759,8 +753,8 @@ stop-on-error = true
[bash-profile]
recipe = slapos.recipe.template:jinja2
template = ${template-bash-profile:target}
rendered = $${buildout:directory}/.bash_profile
url = ${template-bash-profile:target}
output = $${buildout:directory}/.bash_profile
context =
raw path $${shell-environment:path}
raw shell $${shell-environment:shell}
......@@ -826,19 +820,18 @@ slapformat-definition.cfg = $${slaprunner:slapformat-definition.cfg}
[supervisord-conf]
recipe = slapos.recipe.template:jinja2
template = ${template-supervisord:target}
rendered = $${directory:etc}/supervisord.conf
url = ${template-supervisord:target}
output = $${directory:etc}/supervisord.conf
context =
import multiprocessing multiprocessing
section supervisord supervisord
key slapparameter_dict slap-configuration:configuration
key listener_slapgrid listener-slapgrid-bin:rendered
key listener_slapgrid listener-slapgrid-bin:output
[listener-slapgrid-bin]
recipe = slapos.recipe.template:jinja2
template = ${template-listener-slapgrid:target}
rendered = $${directory:bin}/listener_slapgrid.py
mode = 0744
url = ${template-listener-slapgrid:target}
output = $${directory:bin}/listener_slapgrid.py
context =
section supervisord supervisord
section slaprunner slaprunner
......@@ -846,7 +839,7 @@ context =
[supervisord-wrapper]
recipe = slapos.cookbook:wrapper
command-line = ${buildout:bin-directory}/supervisord -c $${supervisord-conf:rendered} --nodaemon
command-line = ${buildout:bin-directory}/supervisord -c $${supervisord-conf:output} --nodaemon
wrapper-path = $${directory:services}/supervisord
hash-existing-files = $${buildout:directory}/software_release/buildout.cfg
......@@ -904,18 +897,16 @@ private-path-list +=
$${logrotate-directory:logrotate-backup}
[monitor-check-webrunner-internal-instance]
recipe = slapos.recipe.template:jinja2
template = ${monitor-check-webrunner-internal-instance:target}
rendered = $${monitor-directory:bin}/$${:filename}
recipe = slapos.recipe.template
url = ${monitor-check-webrunner-internal-instance:target}
output = $${monitor-directory:bin}/$${:filename}
filename = monitor-check-webrunner-internal-instance
mode = 0744
## Slapuser slapos command script
[template-slapuser-script]
recipe = slapos.recipe.template:jinja2
template = ${template-slapuser-script:target}
rendered = $${buildout:bin-directory}/slapos
mode = 0744
url = ${template-slapuser-script:target}
output = $${buildout:bin-directory}/slapos
context =
raw config_location $${slapos-cfg:rendered}
raw config_location $${slapos-cfg:output}
raw slapos_python_file_location ${buildout:bin-directory}/slapos
......@@ -11,21 +11,21 @@ extends =
[switch_softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = $${:runner}
resilient = instance-resilient:rendered
runner = instance-base-runner:rendered
runner-import = template-runner-import:rendered
runner-export = template-runner-export:rendered
resilient = instance-resilient:output
runner = instance-base-runner:output
runner-import = template-runner-import:output
runner-export = template-runner-export:output
frozen = instance-frozen:rendered
pull-backup = template-pull-backup:rendered
frozen = instance-frozen:output
pull-backup = template-pull-backup:output
# BBB
RootSoftwareInstance = $${:default}
[instance-base-runner]
recipe = slapos.recipe.template:jinja2
template = ${template-runner:output}
rendered = $${buildout:directory}/template-runner.cfg
url = ${template-runner:output}
output = $${buildout:directory}/template-runner.cfg
extensions = jinja2.ext.do
context = key buildout buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
......@@ -34,32 +34,29 @@ context = key buildout buildout:bin-directory
raw curl_executable_location ${curl:location}/bin/curl
raw dash_executable_location ${dash:location}/bin/dash
raw dcron_executable_location ${dcron:location}/sbin/crond
mode = 0644
[instance-resilient]
recipe = slapos.recipe.template:jinja2
template = ${template-resilient:target}
rendered = $${buildout:directory}/instance-resilient.cfg
url = ${template-resilient:target}
output = $${buildout:directory}/instance-resilient.cfg
extensions = jinja2.ext.do
context = key buildout buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration
raw monitor_template ${monitor-template:rendered}
raw monitor_template ${monitor-template:output}
template-parts-destination = ${template-parts:target}
template-replicated-destination = ${template-replicated:target}
import-list = file parts :template-parts-destination
file replicated :template-replicated-destination
mode = 0644
[template-runner-export]
recipe = slapos.recipe.template:jinja2
template = ${instance-runner-export:target}
rendered = $${buildout:directory}/instance-runner-export.cfg
mode = 640
url = ${instance-runner-export:target}
output = $${buildout:directory}/instance-runner-export.cfg
context =
key pbsready_export_template_path template-pbsready-export:rendered
key template_runner_path instance-base-runner:rendered
key pbsready_export_template_path template-pbsready-export:output
key template_runner_path instance-base-runner:output
key slapparameter_dict slap-configuration:configuration
raw software_release_bin ${buildout:bin-directory}
raw backup_wait_time ${exporter-default-configuration:backup_wait_time}
......@@ -70,12 +67,11 @@ context =
[template-runner-import]
recipe = slapos.recipe.template:jinja2
template = ${instance-runner-import:target}
rendered = $${buildout:directory}/instance-runner-import.cfg
mode = 640
url = ${instance-runner-import:target}
output = $${buildout:directory}/instance-runner-import.cfg
context =
key pbsready_import_template_path template-pbsready-import:rendered
key template_runner_path instance-base-runner:rendered
key pbsready_import_template_path template-pbsready-import:output
key template_runner_path instance-base-runner:output
key slapparameter_dict slap-configuration:configuration
raw software_release_bin ${buildout:bin-directory}
raw importer_script_path ${template-runner-import-script:target}
......
......@@ -15,19 +15,19 @@
[instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = f8dde54b49aa62669c588913d21c6b15
md5sum = c9cd1d4c61733fb56078a99de9062800
[instance]
_update_hash_filename_ = instance.cfg.in
md5sum = f2f01a47d98a980177dc1755e618bbb7
md5sum = af4d92a95dc25c2f64ddbd634996e46c
[instance-import]
_update_hash_filename_ = instance-import.cfg.jinja.in
md5sum = 74b9b46769a25add50f9f63365de58ad
md5sum = 6e5092422c97c21f02f7b7b3ff015367
[instance-export]
_update_hash_filename_ = instance-export.cfg.jinja.in
md5sum = b3f1dd83033d6a45def0bd26e70d5a9c
md5sum = 31a94c7a5ef18dbad807c0b57dfe6e0c
[instance-resilient]
_update_hash_filename_ = instance-resilient.cfg.jinja
......
......@@ -24,12 +24,11 @@ namebase = {{ parameter_dict['namebase'] }}
# to be pulled from the export instance.
# All it expects is that a script be available in exporter:wrapper.
[exporter]
wrapper = $${theia-export-script:rendered}
wrapper = $${theia-export-script:output}
[theia-export-script]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/theia-export-script
mode = 0700
output = $${directory:bin}/theia-export-script
exitcode-file = $${directory:srv}/export-exitcode-file
error-file = $${directory:srv}/export-errormessage-file
context =
......@@ -46,8 +45,8 @@ context =
key exitfile :exitcode-file
key errorfile :error-file
{%- raw %}
template =
inline:#!{{ bash }}
inline =
#!{{ bash }}
{{ python }} {{ theia_export }} \
--rsync {{ rsync }} \
--sqlite3 {{ sqlite3 }} \
......@@ -71,24 +70,24 @@ export-promises =
<= monitor-promise-base
promise = check_command_execute
name = resiliency-export-promise.py
config-command = $${export-promise-script:rendered}
config-command = $${export-promise-script:output}
[initial-export-exitcode-file]
recipe = slapos.recipe.template:jinja2
rendered = $${theia-export-script:exitcode-file}
template = inline:0
once = $${:rendered}
output = $${theia-export-script:exitcode-file}
inline =0
once = $${:output}
[export-promise-script]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/export-promise-script
exitcode-file = $${initial-export-exitcode-file:rendered}
output = $${directory:bin}/export-promise-script
exitcode-file = $${initial-export-exitcode-file:output}
context =
key exitcodefile :exitcode-file
key errorfile theia-export-script:error-file
{%- raw %}
template =
inline:#!/bin/sh
inline =
#!/bin/sh
if [ -z $(find {{ repr(exitcodefile) }} -mtime -2) ]
then
echo "ERROR export script last ran on " $(date -r {{ repr(exitcodefile) }})
......
......@@ -74,12 +74,11 @@ install =
os.symlink("/bin/true", location)
[importer]
wrapper = $${theia-import-script:rendered}
wrapper = $${theia-import-script:output}
[theia-import-script]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/theia-import-script
mode = 0700
output = $${directory:bin}/theia-import-script
exitcode-file = $${directory:srv}/import-exitcode-file
error-file = $${directory:srv}/import-errormessage-file
context =
......@@ -101,10 +100,10 @@ context =
key exitfile :exitcode-file
key errorfile :error-file
{%- raw %}
template =
inline:#!{{ bash }}
. $${common-environment:rendered}
. $${slapos-standalone-activate:rendered}
inline =
#!{{ bash }}
. $${common-environment:output}
. $${slapos-standalone-activate:output}
{{ python }} {{ theia_import }} \
--rsync {{ rsync }} \
--sqlite3 {{ sqlite3 }} \
......@@ -133,24 +132,24 @@ import-promises =
<= monitor-promise-base
promise = check_command_execute
name = resiliency-import-promise.py
config-command = $${import-promise-script:rendered}
config-command = $${import-promise-script:output}
[initial-import-exitcode-file]
recipe = slapos.recipe.template:jinja2
rendered = $${theia-import-script:exitcode-file}
template = inline:0
once = $${:rendered}
output = $${theia-import-script:exitcode-file}
inline =0
once = $${:output}
[import-promise-script]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/import-promise-script
exitcode-file = $${initial-import-exitcode-file:rendered}
output = $${directory:bin}/import-promise-script
exitcode-file = $${initial-import-exitcode-file:output}
context =
key exitcodefile :exitcode-file
key errorfile theia-import-script:error-file
{%- raw %}
template =
inline:#!/bin/sh
inline =
#!/bin/sh
if [ -z $(find {{ repr(exitcodefile) }} -mtime -2) ]
then
echo "ERROR import script last ran on " $(date -r {{ repr(exitcodefile) }})
......
......@@ -3,7 +3,7 @@
[buildout]
extends =
${monitor-template:rendered}
${monitor-template:output}
theia-environment-parts =
tasks.json
......@@ -229,10 +229,9 @@ location =
$${:cert-file}
[frontend-instance-config]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/$${:_buildout_section_name_}
template =
inline:
recipe = slapos.recipe.template
output = $${directory:etc}/$${:_buildout_section_name_}
inline =
:$${:port} {
bind $${:ip}
tls $${frontend-instance-certificate:cert-file} $${frontend-instance-certificate:key-file}
......@@ -268,7 +267,7 @@ port = $${frontend-instance-port:port}
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line =
${caddy:output} -conf $${frontend-instance-config:rendered} -pidfile $${:pidfile}
${caddy:output} -conf $${frontend-instance-config:output} -pidfile $${:pidfile}
ip = $${frontend-instance-config:ip}
hostname = $${frontend-instance-config:hostname}
......@@ -298,8 +297,8 @@ stop-on-error = true
[frontend-instance-slapos.css]
recipe = slapos.recipe.template:jinja2
template = ${slapos.css.in:output}
rendered = $${directory:frontend-static}/$${:folder-name}/slapos.css
url = ${slapos.css.in:output}
output = $${directory:frontend-static}/$${:folder-name}/slapos.css
folder-name = css
context =
key logo_image frontend-instance-logo:filename
......@@ -312,7 +311,7 @@ command-line =
"kill -s USR1 $$(${coreutils:location}/bin/cat $${frontend-instance:pidfile}) \
&& ${coreutils:location}/bin/sleep infinity"
hash-files =
$${frontend-instance-config:rendered}
$${frontend-instance-config:output}
$${frontend-instance:wrapper-path}
wait-for-files = $${frontend-instance:pidfile}
......@@ -345,11 +344,9 @@ filename = $${:_buildout_section_name_}
# ------------------
[common-environment]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700
template =
inline:
recipe = slapos.recipe.template
output = $${directory:bin}/$${:_buildout_section_name_}
inline =
#!/bin/sh
export HOME=$${directory:home}
export PATH=${python-language-server:location}/bin:${java-jdk:location}/bin:${cli-utilities:PATH}:$HOME/.cargo/bin:$PATH
......@@ -365,11 +362,10 @@ maximum = 3600
ip = {{ ipv4_random }}
[theia-service]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700
template =
inline:#!/bin/sh
recipe = slapos.recipe.template
output = $${directory:bin}/$${:_buildout_section_name_}
inline =
#!/bin/sh
{{ "{% raw %}" }}
{% raw %}
export THEIA_WEBVIEW_EXTERNAL_ENDPOINT='{{hostname}}'
......@@ -378,15 +374,15 @@ template =
{{ "{% endraw %}" }}
export THEIA_OPEN_EDITOR_TOKEN=$(${openssl:location}/bin/openssl rand -hex 32)
export THEIA_URL=$${:base-url}
export THEIA_SHELL=$${theia-shell:rendered}
export THEIA_SHELL=$${theia-shell:output}
export TMP=$${directory:tmp}
export TEMP=$TMP
export LC_ALL=C.UTF-8
export TERMINFO=${ncurses:location}/lib/terminfo/
export EDITOR="${theia-open:rendered} --wait"
export EDITOR="${theia-open:output} --wait"
export THEIA_DEFAULT_PLUGINS="local-dir:${theia-plugins:location}"
. $${common-environment:rendered}
exec ${theia-wrapper:rendered} "$@"
. $${common-environment:output}
exec ${theia-wrapper:output} "$@"
ip = $${theia-service-port:ip}
port = $${theia-service-port:port}
base-url = http://$${:ip}:$${:port}/
......@@ -394,10 +390,10 @@ base-url = http://$${:ip}:$${:port}/
[theia-instance]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line = $${theia-service:rendered} --hostname=$${:hostname} --port=$${:port} $${directory:project}
command-line = $${theia-service:output} --hostname=$${:hostname} --port=$${:port} $${directory:project}
hash-existing-files =
${yarn.lock:target}
${theia-wrapper:rendered}
${theia-wrapper:output}
ip = {{ ipv4_random }}
hostname = $${:ip}
port = $${theia-service:port}
......@@ -405,11 +401,8 @@ base-url = $${theia-service:base-url}
[theia-shell]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700
template =
{% raw %}
inline:#!{{ bash }}
output = $${directory:bin}/$${:_buildout_section_name_}
inline ={% raw %}#!{{ bash }}
SHELL=$BASH
# when running interactively, activate slapos configuration and reset GIT_EXEC_PATH to workaround https://github.com/eclipse-theia/theia/issues/7555
if [ $# = 0 ]; then
......@@ -421,14 +414,13 @@ template =
{% endraw %}
context =
raw bash ${bash:location}/bin/bash
key activate slapos-standalone-activate:rendered
key bashrc theia-bashrc:rendered
key activate slapos-standalone-activate:output
key bashrc theia-bashrc:output
[theia-bashrc]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/$${:_buildout_section_name_}
template =
inline:
recipe = slapos.recipe.template
output = $${directory:etc}/$${:_buildout_section_name_}
inline =
# enable bash completion
. ${bash-completion:location}/etc/profile.d/bash_completion.sh
# source user's .bashrc
......@@ -456,23 +448,21 @@ command =
{%- set embedded_sr = os_module.path.normpath(embedded_sr) %}
{%- endif %}
[request-embedded-instance-script]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:project}/request_embedded.sh
mode = 0700
template =
inline:#!/bin/sh
recipe = slapos.recipe.template
output = $${directory:project}/request_embedded.sh
inline =
#!/bin/sh
slapos supply {{ embedded_sr }} slaprunner
slapos request "embedded_instance" {{ embedded_sr }}
{%- if embedded_sr_type %} --type {{ embedded_sr_type }} {%- endif %}
{%- if embedded_instance_parameters %} --parameters-file $${embedded-instance-parameters:rendered}
{%- if embedded_instance_parameters %} --parameters-file $${embedded-instance-parameters:output}
[embedded-instance-parameters]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:project}/$${:_buildout_section_name_}.json
template =
inline:{{ embedded_instance_parameters | indent(2) }}
recipe = slapos.recipe.template
output = $${directory:project}/$${:_buildout_section_name_}.json
inline ={{ embedded_instance_parameters | indent(2) }}
{%- endif %}
{%- endif %}
......@@ -499,20 +489,19 @@ computer-id = slaprunner
abstract-socket-path = $${directory:home}/standalone-{{ embedded_digest_hash[:16] }}
[slapos-standalone-activate]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
template =
inline:
recipe = slapos.recipe.template
output = $${directory:bin}/$${:_buildout_section_name_}
inline =
export PATH=${buildout:bin-directory}:$PATH
export SLAPOS_CONFIGURATION=$${slapos-standalone-config:slapos-configuration}
export SLAPOS_CLIENT_CONFIGURATION=$SLAPOS_CONFIGURATION
echo 'Standalone SlapOS for computer `$${slapos-standalone-config:computer-id}` activated'
[slapos-standalone-script]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
template =
inline:#!${python-for-standalone:executable}
recipe = slapos.recipe.template
output = $${directory:bin}/$${:_buildout_section_name_}
inline =
#!${python-for-standalone:executable}
import glob
import json
import os
......@@ -583,13 +572,13 @@ template =
print("Exception in compatibility layer, printing and moving on")
traceback.print_exc()
# Run request script
print("Running SlapOS script $${request-embedded-instance-script:rendered}")
print("Running SlapOS script $${request-embedded-instance-script:output}")
slapos_env = {
'PATH': os.path.dirname(standalone._slapos_bin),
'SLAPOS_CONFIGURATION': standalone._slapos_config,
'SLAPOS_CLIENT_CONFIGURATION': standalone._slapos_config
}
subprocess.call(("$${request-embedded-instance-script:rendered}",), env=slapos_env)
subprocess.call(("$${request-embedded-instance-script:output}",), env=slapos_env)
{%- endif %}
s = socket.socket(socket.AF_UNIX)
s.bind("\0$${slapos-standalone-config:abstract-socket-path}")
......@@ -603,24 +592,23 @@ template =
print("Exiting")
[slapos-standalone]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700
template =
inline:#!/bin/sh
. $${common-environment:rendered}
recipe = slapos.recipe.template
output = $${directory:bin}/$${:_buildout_section_name_}
inline =
#!/bin/sh
. $${common-environment:output}
#XXX find out where the extra nodejs in theia's PATH comes from
export PATH=${nodejs:location}/bin/:$PATH
. $${slapos-standalone-activate:rendered}
exec $${slapos-standalone-script:rendered}
. $${slapos-standalone-activate:output}
exec $${slapos-standalone-script:output}
[slapos-standalone-instance]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line = $${slapos-standalone:rendered}
command-line = $${slapos-standalone:output}
hash-files =
$${slapos-standalone:rendered}
$${slapos-standalone-script:rendered}
$${slapos-standalone:output}
$${slapos-standalone-script:output}
hostname = $${slapos-standalone-config:ipv4}
port = $${slapos-standalone-config:port}
......@@ -645,10 +633,9 @@ autorun = {{ parameter_dict['autorun'] }}
# -----------------------------
[tasks.json]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:dot-theia}/tasks.json
template =
inline:
recipe = slapos.recipe.template
output = $${directory:dot-theia}/tasks.json
inline =
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
......@@ -715,10 +702,9 @@ git-executable = ${git:location}/bin/git
[settings.json]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:dot-theia}$${:_buildout_section_name_}
once = $${:rendered}
template =
inline:
output = $${directory:dot-theia}$${:_buildout_section_name_}
once = $${:output}
inline =
{
"files.watcherExclude": {
"**/.eggs/**": true,
......@@ -738,11 +724,10 @@ target-directory = $${directory:project}
link-binary = $${directory:runner}
[request-script-template]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:project}/$${:_buildout_section_name_}.sh
mode = 0700
template =
inline:#!/bin/sh
recipe = slapos.recipe.template
output = $${directory:project}/$${:_buildout_section_name_}.sh
inline =
#!/bin/sh
# This template is generated automatically, copy it in order to supply and request.
# Any manual change to this file may be lost.
software_name=html5as-base #replace the software name writen in ~/srv/project/slapos/software/
......
......@@ -20,18 +20,17 @@ cert = $${slap-connection:cert-file}
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = $${:default}
default = $${:theia}
theia = theia:rendered
export = export:rendered
import = import:rendered
resilient = resilient:rendered
frozen = instance-frozen:rendered
pull-backup = template-pull-backup:rendered
theia = theia:output
export = export:output
import = import:output
resilient = resilient:output
frozen = instance-frozen:output
pull-backup = template-pull-backup:output
[theia]
recipe = slapos.recipe.template:jinja2
template = ${instance-theia:output}
rendered = $${buildout:directory}/instance-theia.cfg
mode = 0644
url = ${instance-theia:output}
output = $${buildout:directory}/instance-theia.cfg
context =
jsonkey default_parameter_dict :default-parameters
key parameter_dict slap-configuration:configuration
......@@ -61,39 +60,36 @@ frontend-sr = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/ap
[import]
recipe = slapos.recipe.template:jinja2
template = ${instance-import:output}
rendered = $${buildout:directory}/instance-import.cfg
mode = 0644
url = ${instance-import:output}
output = $${buildout:directory}/instance-import.cfg
context =
jsonkey default_parameter_dict theia:default-parameters
key parameter_dict slap-configuration:configuration
key theia_instance_cfg theia:rendered
key pbsready_import_cfg template-pbsready-import:rendered
key theia_instance_cfg theia:output
key pbsready_import_cfg template-pbsready-import:output
key root_title slap-configuration:root-instance-title
[export]
recipe = slapos.recipe.template:jinja2
template = ${instance-export:output}
rendered = $${buildout:directory}/instance-export.cfg
mode = 0644
url = ${instance-export:output}
output = $${buildout:directory}/instance-export.cfg
context =
jsonkey default_parameter_dict theia:default-parameters
key parameter_dict slap-configuration:configuration
key theia_instance_cfg theia:rendered
key pbsready_export_cfg template-pbsready-export:rendered
key theia_instance_cfg theia:output
key pbsready_export_cfg template-pbsready-export:output
[resilient]
recipe = slapos.recipe.template:jinja2
template = ${instance-resilient:output}
rendered = $${buildout:directory}/instance-resilient.cfg
mode = 0644
url = ${instance-resilient:output}
output = $${buildout:directory}/instance-resilient.cfg
extensions = jinja2.ext.do
context =
key buildout buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration
raw monitor_template ${monitor-template:rendered}
raw monitor_template ${monitor-template:output}
template-parts-destination = ${template-parts:target}
template-replicated-destination = ${template-replicated:target}
import-list = file parts :template-parts-destination
......
......@@ -18,30 +18,33 @@ run = $${:etc}/run
command = mkdir -p $${:run} $${:srv}
[log-writer]
recipe = slapos.recipe.template:jinja2
template = inline:#!/bin/sh
recipe = slapos.recipe.template
inline =
#!/bin/sh
echo "Hello : $(date)" >> $${directory:home}/log.log
rendered = $${directory:run}/log-writer
output = $${directory:run}/log-writer
[exporter.exclude]
recipe = slapos.recipe.template:jinja2
template = inline:$${directory:home}/exclude
rendered = $${directory:srv}/exporter.exclude
recipe = slapos.recipe.template
inline =$${directory:home}/exclude
output = $${directory:srv}/exporter.exclude
[runner-import-restore]
recipe = slapos.recipe.template:jinja2
template = inline:#!/bin/sh
recipe = slapos.recipe.template
inline =
#!/bin/sh
echo "Hello : $(date)" >> $${directory:home}/runner-import-restore.log
exit $TEST_RESTORE_STATUS
rendered = $${directory:srv}/runner-import-restore
output = $${directory:srv}/runner-import-restore
[backup-identity-script]
recipe = slapos.recipe.template:jinja2
template = inline:#!/bin/sh
recipe = slapos.recipe.template
inline =
#!/bin/sh
echo "Custom script"
for i in "$@"
do
echo $(sha256sum $i)
done
exit $TEST_BACKUP_STATUS
rendered = $${directory:srv}/.backup_identity_script
output = $${directory:srv}/.backup_identity_script
......@@ -18,7 +18,6 @@ eggs = plone.recipe.command
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
mode = 0644
[versions]
setuptools = 44.0.0
......
......@@ -14,12 +14,12 @@
# not need these here).
[template]
filename = instance.cfg
md5sum = cad8d9c7c17808f23eee936f149183a9
md5sum = e70978c8b5d7ad6a98b5a12185236733
[template-tsn-client]
filename = instance-tsn-client.cfg
md5sum = 829e50492ef9adb0037b82c814f76afd
md5sum = fd7370bd109821b73360e8a303042ade
[template-tsn-server]
filename = instance-tsn-server.cfg
md5sum = 5ce17649f54faf2a9e2a05774d643041
md5sum = b048114a5fd5b533bd7706fc2cc6fd89
......@@ -15,8 +15,8 @@ scripts = $${:etc}/tsn
run = $${:etc}/run
[tsn-script-template]
recipe = slapos.recipe.template:jinja2
rendered= $${directory:scripts}/$${:_buildout_section_name_}
recipe = slapos.recipe.template
output= $${directory:scripts}/$${:_buildout_section_name_}
mode = 755
{% for server_nb, server_guid in enumerate(server_guid_list) -%}
......@@ -45,7 +45,7 @@ config-interface = {{ server_interface_list[server_nb] }}
{% do script_list.append(phc2sys_launcher_section_title) -%}
[{{ phc2sys_launcher_section_title }}]
<= tsn-script-template
template= inline:
inline =
#!/bin/sh
${linuxptp:location}/sbin/pmc -u -b 0 -i {{ interface_list[server_nb] }} "SET GRANDMASTER_SETTINGS_NP clockClass 248 clockAccuracy 0xfe offsetScaledLogVariance 0xffff currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1 ptpTimescale 1 timeTraceable 1 frequencyTraceable 0 timeSource 0xa0"
exec {{ chrt }} -f 95 ${linuxptp:location}/sbin/phc2sys -s CLOCK_REALTIME -c {{ interface_list[server_nb] }} --step_threshold=1 -m -w
......@@ -56,7 +56,7 @@ template= inline:
{% do script_list.append(ptp4l_launcher_section_title) -%}
[{{ ptp4l_launcher_section_title }}]
<= tsn-script-template
template= inline:
inline =
#!/bin/sh
exec {{ chrt }} -f 97 ${linuxptp:location}/sbin/ptp4l {{ '-H' if hardware_timestamps=='y' else '-S' }} -i {{ interface_list[server_nb] }} --step_threshold=1 -m
......@@ -64,7 +64,7 @@ template= inline:
[tsn-script]
<= tsn-script-template
template= inline:
inline =
#!/bin/sh
exec ${tsn-rt-measures:location}/bin/master -a1 -p97 -t4000 {{ interface_ip_string_list | join(' ') }}
......@@ -79,6 +79,6 @@ parts =
[publish-connection-information]
recipe = slapos.cookbook:publish
{% for script in script_list -%}
{{ script }} = {{ '$${' ~ script ~ ':rendered}' }}
{{ script }} = {{ '$${' ~ script ~ ':output}' }}
{% endfor -%}
tsn-script = $${tsn-script:rendered}
tsn-script = $${tsn-script:output}
......@@ -34,24 +34,24 @@ init =
setup_gpio(options["gpio-pulse-pin"])
[tsn-script-template]
recipe = slapos.recipe.template:jinja2
rendered= $${directory:scripts}/$${:_buildout_section_name_}
recipe = slapos.recipe.template
output= $${directory:scripts}/$${:_buildout_section_name_}
mode = 755
[ptp4l-launcher-{{ interface }}]
<= tsn-script-template
template= inline:
inline =
#!/bin/sh
exec {{ chrt }} -f 97 ${linuxptp:location}/sbin/ptp4l -s -S -i {{ interface }} --step_threshold=1 -m
[tsn-script]
<= tsn-script-template
template= inline:
inline =
#!/bin/sh
exec ${tsn-rt-measures:location}/bin/slave -f {{ interface }} -a1 -p98 -d {{ gpio_direction_pin }} -u {{ gpio_pulse_pin }}
[publish-connection-information]
recipe = slapos.cookbook:publish
ip = {{ ip }}
ptp4l-launcher-{{ interface }} = $${ptp4l-launcher-{{ interface }}:rendered}
tsn-script = $${tsn-script:rendered}
ptp4l-launcher-{{ interface }} = $${ptp4l-launcher-{{ interface }}:output}
tsn-script = $${tsn-script:output}
......@@ -8,13 +8,13 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = tsn-client-dynamic-template:rendered
tsn-server = tsn-server-dynamic-template:rendered
default = tsn-client-dynamic-template:output
tsn-server = tsn-server-dynamic-template:output
RootSoftwareInstance = $${:default}
[dynamic-template-base]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/$${:filename}
output = $${buildout:directory}/$${:filename}
context =
raw chrt ${util-linux:location}/bin/chrt
key slapparameter_dict slap-configuration:configuration
......@@ -23,12 +23,12 @@ context =
[tsn-client-dynamic-template]
<= dynamic-template-base
extensions = jinja2.ext.do
template = ${template-tsn-client:output}
url = ${template-tsn-client:output}
filename = instance-tsn-client.cfg
[tsn-server-dynamic-template]
<= dynamic-template-base
template = ${template-tsn-server:output}
url = ${template-tsn-server:output}
filename = instance-tsn-server.cfg
[slap-configuration]
......
......@@ -21,7 +21,6 @@ eggs =
[template-base]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
mode = 0644
[template]
< = template-base
......
......@@ -15,11 +15,11 @@
[instance-cfg]
filename = instance.cfg.in
md5sum = 403fe1e79e20ab87589092ce7429e73b
md5sum = f47adc5131a3096e916dbf9ef0061f50
[template-turnserver]
filename = instance-turnserver.cfg.jinja2.in
md5sum = 932c4d82faa8e28b62bfbfc3dfe31c02
md5sum = b71bcc86f217cd737fc890667adb7c69
[template-insecure-turnserver]
filename = instance-insecure-turnserver.cfg.jinja2.in
......
......@@ -17,7 +17,7 @@ ssl = ${:etc}/ssl
[file-base]
recipe = slapos.recipe.template:jinja2
template = inline:{{ '{{ content }}' }}
inline ={{ '{{ content }}' }}
{% macro simplefile(section_name, file_path, content, mode='') -%}
......@@ -26,7 +26,7 @@ template = inline:{{ '{{ content }}' }}
content = {{ dumps(content) }}
[{{ section_name }}]
< = file-base
rendered = {{ file_path }}
output = {{ file_path }}
context = key content {{ content_section_name }}:content
mode = {{ mode }}
{% do part_list.append(section_name) -%}
......
......@@ -9,8 +9,8 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = $${:default}
default = dynamic-template-turnserver:rendered
insecure = dynamic-template-insecure-turnserver:rendered
default = dynamic-template-turnserver:output
insecure = dynamic-template-insecure-turnserver:output
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
......@@ -22,9 +22,8 @@ cert = $${slap-connection:cert-file}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/$${:filename}
output = $${buildout:directory}/$${:filename}
extensions = jinja2.ext.do
mode = 0644
extra-context =
context =
key develop_eggs_directory buildout:develop-eggs-directory
......@@ -34,8 +33,8 @@ context =
key global_ipv4_prefix network-information:global-ipv4-network
key slapparameter_dict slap-configuration:configuration
key computer_id slap-configuration:computer
raw template_monitor ${monitor2-template:rendered}
raw logrotate_cfg ${template-logrotate-base:rendered}
raw template_monitor ${monitor2-template:output}
raw logrotate_cfg ${template-logrotate-base:output}
$${:extra-context}
jsonkey default_parameter_dict :default-parameters
default-parameters =
......@@ -56,14 +55,14 @@ turnserver-location = ${coturn:location}
[dynamic-template-turnserver]
<= jinja2-template-base
template = ${template-turnserver:location}/${template-turnserver:filename}
url = ${template-turnserver:location}/${template-turnserver:filename}
filename = instance-turnserver.cfg
extra-context =
section parameter_dict dynamic-template-turnserver-parameters
[dynamic-template-insecure-turnserver]
<= jinja2-template-base
template = ${template-insecure-turnserver:location}/${template-insecure-turnserver:filename}
url = ${template-insecure-turnserver:location}/${template-insecure-turnserver:filename}
filename = instance-insecure-turnserver.cfg
extra-context =
section parameter_dict dynamic-template-turnserver-parameters
......@@ -25,7 +25,7 @@ extra =
[feeder]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line = ${feeder:bin-directory}/feeder $${fluentd-agent-conf:rendered}
command-line = ${feeder:bin-directory}/feeder $${fluentd-agent-conf:output}
$${:_buildout_section_name_} .4
{%- for tag in tags %}
[{{ section(tag) }}]
......@@ -36,15 +36,14 @@ extra =
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line = ${fluentd:location}/bin/fluentd
-v -c $${fluentd-agent-conf:rendered}
-v -c $${fluentd-agent-conf:output}
environment =
GEM_PATH=${fluentd:location}/lib/ruby/gems/1.8
[fluentd-agent-conf]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/fluentd-agent.conf
template =
inline:{% raw -%}
output = $${directory:etc}/fluentd-agent.conf
inline ={% raw -%}
<match debug.**>
@type stdout
@id stdout_output
......
......@@ -19,11 +19,10 @@ extends = test-common.cfg
parts += start_ingest start_process
[start-script-common]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
mode = 0755
template =
inline:#!${buildout:executable}
recipe = slapos.recipe.template
output = ${buildout:bin-directory}/${:_buildout_section_name_}
inline =
#!${buildout:executable}
import argparse, base64, httplib, sys
parser = argparse.ArgumentParser()
_ = parser.add_argument
......
......@@ -16,4 +16,3 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = 98a680fe8fddce5dcee455e65c228fde
output = ${buildout:directory}/template.cfg
mode = 0644
......@@ -15,4 +15,4 @@
[caucase-jinja2-library]
filename = caucase.jinja2.library
md5sum = 1e3607e514320441ddccdb6d1a21f705
md5sum = 962ee4f16cef2b4b44ce0f5a87f7549c
......@@ -75,19 +75,19 @@ content = {{ template_csr }}
{% endif %}
[{{ prefix }}-provided-csr]
recipe = slapos.recipe.template:jinja2
mode = 644
{% if template_csr_pem %}
template = inline:{{ '{{ content }}' }}
rendered = ${ {{- prefix }}-directory:data-dir}/provided.csr.pem
inline =
{{ '{{ content }}' }}
output = ${ {{- prefix }}-directory:data-dir}/provided.csr.pem
context = key content {{ prefix }}-provided-csr-content:content
{% elif template_csr %}
template = {{ '${' + prefix }}-provided-csr-content:content}
rendered = ${ {{- prefix }}-directory:data-dir}/provided.csr.pem
url = {{ '${' + prefix }}-provided-csr-content:content}
output = ${ {{- prefix }}-directory:data-dir}/provided.csr.pem
{% endif %}
{{ rerequest(
prefix=prefix ~ '-csr',
buildout_bin_directory=buildout_bin_directory,
template='${' ~ prefix ~ '-provided-csr:rendered}',
template='${' ~ prefix ~ '-provided-csr:output}',
csr='${:csr}',
key=key_path,
)}}
......
......@@ -91,7 +91,7 @@ parts +=
# override instance-jupyter-notebook not to render into default template.cfg
[instance-jupyter-notebook]
rendered = ${buildout:directory}/template-jupyter.cfg
output = ${buildout:directory}/template-jupyter.cfg
[download-base]
<= download-base-neo
......@@ -154,9 +154,8 @@ link-binary =
[template]
recipe = slapos.recipe.template:jinja2
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/${:filename}
mode = 640
output = ${buildout:directory}/template.cfg
url = ${:_profile_base_location_}/${:filename}
context =
key mariadb_link_binary template-mariadb:link-binary
key zope_link_binary template-zope:link-binary
......@@ -180,7 +179,7 @@ context =
key haproxy_location haproxy:location
key socat_location socat:location
key rsyslogd_location rsyslogd:location
key instance_common_cfg instance-common:rendered
key instance_common_cfg instance-common:output
key jsl_location jsl:location
key jupyter_enable_default erp5-defaults:jupyter-enable-default
key wcfs_enable_default erp5-defaults:wcfs-enable-default
......@@ -211,12 +210,12 @@ context =
key template_erp5 template-erp5:target
key template_haproxy_cfg template-haproxy-cfg:target
key template_rsyslogd_cfg template-rsyslogd-cfg:target
key template_jupyter_cfg instance-jupyter-notebook:rendered
key template_jupyter_cfg instance-jupyter-notebook:output
key template_kumofs template-kumofs:target
key template_mariadb template-mariadb:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_my_cnf template-my-cnf:target
key template_mysqld_wrapper template-mysqld-wrapper:rendered
key template_mysqld_wrapper template-mysqld-wrapper:output
key template_postfix template-postfix:target
key template_postfix_aliases template-postfix-aliases:target
key template_postfix_main_cf template-postfix-main-cf:target
......
......@@ -26,11 +26,11 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb]
filename = instance-mariadb.cfg.in
md5sum = b664a2221077db5db498422b6c90f015
md5sum = cee995829fbd138a8c2c9209d72d01a0
[template-kumofs]
filename = instance-kumofs.cfg.in
md5sum = cfe4696a67bf4886a5d8252a5274a941
md5sum = 69954583b5f87aec5ff8449dabaaee56
[template-zope-conf]
filename = zope.conf.in
......@@ -50,7 +50,7 @@ md5sum = f928b9dc99f7f970caadfe7dd6f95d34
[template-postfix]
filename = instance-postfix.cfg.in
md5sum = 0f666e5e7e52afda433feb9f02452717
md5sum = 5c84bbd3e60d86d153c75994679184a8
[template-postfix-master-cf]
filename = postfix_master.cf.in
......@@ -70,7 +70,7 @@ md5sum = 274365ebbade26558ca4836837e781aa
[template]
filename = instance.cfg.in
md5sum = 165b0a50672138ee4a3fbe9239af11ba
md5sum = 9a7f7888ba4183c9d900e862074f3baf
[template-erp5]
filename = instance-erp5.cfg.in
......@@ -78,7 +78,7 @@ md5sum = f5a1661449c9681b3de7d4af645124ba
[template-zeo]
filename = instance-zeo.cfg.in
md5sum = 3c59315a8f102a970dc54ded85df735a
md5sum = c4908c340dbd74f2d434d7e5deebff59
[template-zodb-base]
filename = instance-zodb-base.cfg.in
......@@ -86,11 +86,11 @@ md5sum = 0ac4b74436f554cd677f19275d18d880
[template-zope]
filename = instance-zope.cfg.in
md5sum = 06265195ca29805696873b6f8a57a5fd
md5sum = b6a07f2fab6ff9f54a7d8e7ff9e2b846
[template-balancer]
filename = instance-balancer.cfg.in
md5sum = 8b4d6c29e9c5d8fb2e50e6ac96906d97
md5sum = afd6140a8e8dcd3f95846b546acbeba7
[template-haproxy-cfg]
filename = haproxy.cfg.in
......
......@@ -14,7 +14,6 @@ per partition. No more (undefined result), no less (IndexError).
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
mode = 644
{{ caucase.updater(
prefix='caucase-updater',
......@@ -201,8 +200,8 @@ zope-virtualhost-monster-backend-dict = {{ dumps(zope_virtualhost_monster_backen
[haproxy-cfg]
< = jinja2-template-base
template = {{ parameter_dict['template-haproxy-cfg'] }}
rendered = ${directory:etc}/haproxy.cfg
url = {{ parameter_dict['template-haproxy-cfg'] }}
output = ${directory:etc}/haproxy.cfg
context =
section parameter_dict haproxy-cfg-parameter-dict
import urllib_parse six.moves.urllib.parse
......@@ -220,8 +219,8 @@ input =
[{{ section('haproxy') }}]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services-on-watch}/haproxy
command-line = "{{ parameter_dict['haproxy'] }}/sbin/haproxy" -f "${haproxy-cfg:rendered}"
hash-files = ${haproxy-cfg:rendered}
command-line = "{{ parameter_dict['haproxy'] }}/sbin/haproxy" -f "${haproxy-cfg:output}"
hash-files = ${haproxy-cfg:output}
[apache-conf-ssl]
# XXX caucase is/was buggy and this certificate does not match key for instances
......@@ -231,7 +230,7 @@ caucase-key = ${directory:apache-conf}/apache-caucase.pem
[simplefile]
< = jinja2-template-base
template = inline:{{ '{{ content }}' }}
inline ={{ '{{ content }}' }}
{% macro simplefile(section_name, file_path, content, mode='') -%}
{% set content_section_name = section_name ~ '-content' -%}
......@@ -240,7 +239,7 @@ content = {{ dumps(content) }}
[{{ section(section_name) }}]
< = simplefile
rendered = {{ file_path }}
output = {{ file_path }}
context = key content {{content_section_name}}:content
mode = {{ mode }}
{%- endmacro %}
......@@ -259,16 +258,16 @@ spool-directory = ${directory:rsyslogd-spool}
[rsyslogd-cfg]
<= jinja2-template-base
template = {{ parameter_dict['template-rsyslogd-cfg'] }}
rendered = ${directory:etc}/rsyslogd.conf
url = {{ parameter_dict['template-rsyslogd-cfg'] }}
output = ${directory:etc}/rsyslogd.conf
context = section parameter_dict rsyslogd-cfg-parameter-dict
[{{ section ('rsyslogd') }}]
recipe = slapos.cookbook:wrapper
command-line = {{ parameter_dict['rsyslogd'] }}/sbin/rsyslogd -i ${rsyslogd-cfg-parameter-dict:pid-file} -n -f ${rsyslogd-cfg:rendered}
command-line = {{ parameter_dict['rsyslogd'] }}/sbin/rsyslogd -i ${rsyslogd-cfg-parameter-dict:pid-file} -n -f ${rsyslogd-cfg:output}
wrapper-path = ${directory:services-on-watch}/rsyslogd
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
hash-files = ${rsyslogd-cfg:rendered}
hash-files = ${rsyslogd-cfg:output}
[{{ section ('rsyslogd-listen-promise') }}]
<= monitor-promise-base
......@@ -289,7 +288,7 @@ depends = ${caucase-updater-housekeeper-run:recipe}
[build-certificate-and-key]
{% if ssl_parameter_dict.get('key') -%}
certificate-and-key = ${tls-certificate-and-key-from-parameters:rendered}
certificate-and-key = ${tls-certificate-and-key-from-parameters:output}
{{ simplefile(
'tls-certificate-and-key-from-parameters',
'${directory:etc}/certificate-and-key-from-parameters.pem',
......@@ -347,8 +346,8 @@ client-cert-ca = ${:srv}/client-cert-ca
[{{ section('resiliency-exclude-file') }}]
# Generate rdiff exclude file in case of resiliency
< = jinja2-template-base
template = {{ 'inline:{{ "${directory:log}/**\\n" }}' }}
rendered = ${directory:srv}/exporter.exclude
inline = {{ '{{ "${directory:log}/**\\n" }}' }}
output = ${directory:srv}/exporter.exclude
[{{ section('monitor-generate-apachedex-report') }}]
recipe = slapos.cookbook:cron.d
......@@ -366,9 +365,9 @@ command-line = "{{ parameter_dict['run-apachedex-location'] }}" "{{ parameter_di
command = generate-apachedex-report
[monitor-apachedex-report-config]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/${:_buildout_section_name_}
template = inline:
recipe = slapos.recipe.template
output = ${directory:etc}/${:_buildout_section_name_}
inline =
{% for line in slapparameter_dict['apachedex-configuration'] %}
{# apachedex config files use shlex.split, so we need to quote the arguments. #}
{# BBB: in python 3 we can use shlex.quote instead. #}
......@@ -377,7 +376,7 @@ template = inline:
[apachedex-parameters]
apache-log-list = ${rsyslogd-cfg-parameter-dict:access-log-file}
configuration = ${monitor-apachedex-report-config:rendered}
configuration = ${monitor-apachedex-report-config:output}
promise-threshold = {{ slapparameter_dict['apachedex-promise-threshold'] }}
[{{ section('monitor-promise-apachedex-result') }}]
......
......@@ -78,10 +78,9 @@ kumofs-data = ${:srv}/kumofs
[resiliency-exclude-file]
# Generate rdiff exclude file in case of resiliency
recipe = slapos.recipe.template:jinja2
mode = 644
template = {{ 'inline:{{ "**\\n" }}' }}
rendered = ${directory:srv}/exporter.exclude
recipe = slapos.recipe.template
inline = {{ '{{ "**\\n" }}' }}
output = ${directory:srv}/exporter.exclude
# Deploy zope promises scripts
[promise-template]
......
......@@ -50,17 +50,9 @@ recipe = slapos.cookbook:random.integer
minimum = {{ dumps(1) }}
maximum = {{ dumps(2**32 - 1) }}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
mode = 644
[jinja2-template-executable]
< = jinja2-template-base
mode = 755
[simplefile]
< = jinja2-template-base
template = inline:{{ '{{ content }}' }}
recipe = slapos.recipe.template:jinja2
inline = {{ '{{ content }}' }}
{% macro simplefile(section_name, file_path, content, mode='') -%}
{% set content_section_name = section_name ~ '-content' -%}
......@@ -69,7 +61,7 @@ content = {{ dumps(content) }}
[{{ section(section_name) }}]
< = simplefile
rendered = {{ file_path }}
output = {{ file_path }}
context = key content {{content_section_name}}:content
mode = {{ mode }}
{%- endmacro %}
......@@ -157,9 +149,9 @@ ssl-{{ key }} = {{ value }}
{% endfor %}
[my-cnf]
< = jinja2-template-base
rendered = ${directory:etc}/mariadb.cnf
template = {{ parameter_dict['template-my-cnf'] }}
recipe = slapos.recipe.template:jinja2
output = ${directory:etc}/mariadb.cnf
url = {{ parameter_dict['template-my-cnf'] }}
context = section parameter_dict my-cnf-parameters
[init-script-parameters]
......@@ -167,10 +159,10 @@ database-list = {{ dumps(database_list + test_database_list) }}
mroonga-mariadb-install-sql = {{ dumps(parameter_dict['mroonga-mariadb-install-sql']) }}
[init-script]
< = jinja2-template-executable
recipe = slapos.recipe.template:jinja2
# XXX: is there a better location ?
rendered = ${directory:etc}/mariadb_initial_setup.sql
template = {{ parameter_dict['template-mariadb-initial-setup'] }}
output = ${directory:etc}/mariadb_initial_setup.sql
url = {{ parameter_dict['template-mariadb-initial-setup'] }}
context = section parameter_dict init-script-parameters
[{{ section('update-mysql') }}]
......@@ -178,15 +170,15 @@ recipe = slapos.cookbook:generic.mysql.wrap_update_mysql
output = ${directory:services}/mariadb_update
binary = ${binary-wrap-mysql_upgrade:wrapper-path}
mysql = ${binary-wrap-mysql:wrapper-path}
init-script = ${init-script:rendered}
init-script = ${init-script:output}
mysql_tzinfo_to_sql = ${binary-wrap-mysql_tzinfo_to_sql:wrapper-path}
[{{ section('mysqld') }}]
< = jinja2-template-executable
rendered = ${directory:services}/mariadb
template = {{ parameter_dict['template-mysqld-wrapper'] }}
recipe = slapos.recipe.template:jinja2
output = ${directory:services}/mariadb
url = {{ parameter_dict['template-mysqld-wrapper'] }}
context =
key defaults_file my-cnf:rendered
key defaults_file my-cnf:output
key datadir my-cnf-parameters:data-directory
key environ :environ
environ =
......@@ -218,7 +210,7 @@ link-binary = {{ dumps(parameter_dict['link-binary']) }}
recipe = slapos.cookbook:wrapper
# Note: --defaults-file must be the first argument, otherwise wrapped binary
# will reject it.
command-line = "{{ parameter_dict['mariadb-location'] }}/bin/${:command}" --defaults-file="${my-cnf:rendered}"
command-line = "{{ parameter_dict['mariadb-location'] }}/bin/${:command}" --defaults-file="${my-cnf:output}"
wrapper-path = ${directory:bin}/${:command}
[binary-wrap-mysql]
......@@ -263,9 +255,9 @@ slowquery = ${monitor-directory:private}/slowquery_digest
[{{ section('resiliency-exclude-file') }}]
# Generate rdiff exclude file in case of resiliency
< = jinja2-template-base
template = {{ 'inline:{{ "${my-cnf-parameters:data-directory}/**\\n${directory:mariadb-backup-incremental}/**\\n${directory:log}/**\\n${directory:tmp}/**\\n" }}' }}
rendered = ${directory:srv}/exporter.exclude
recipe = slapos.recipe.template:jinja2
inline = {{ '{{ "${my-cnf-parameters:data-directory}/**\\n${directory:mariadb-backup-incremental}/**\\n${directory:log}/**\\n${directory:tmp}/**\\n" }}' }}
output = ${directory:srv}/exporter.exclude
[{{ section("resiliency-identity-signature-script")}}]
# Generate identity script used by webrunner to check data integrity
......@@ -278,23 +270,23 @@ mode = 770
dash = {{ dumps(dash) }}
[{{ section('start-clone-from-backup') }}]
< = jinja2-template-executable
template = {{ parameter_dict['mariadb-start-clone-from-backup'] }}
rendered = ${directory:bin}/start-clone-from-backup
recipe = slapos.recipe.template:jinja2
url = {{ parameter_dict['mariadb-start-clone-from-backup'] }}
output = ${directory:bin}/start-clone-from-backup
context =
key dash dash:dash
key client binary-wrap-mysql:wrapper-path
key data_directory my-cnf-parameters:data-directory
key pid_file my-cnf-parameters:pid-file
key server mysqld:rendered
key server mysqld:output
key update update-mysql:output
key socket my-cnf-parameters:socket
[{{ section('resiliency-after-import-script') }}]
# Generate after import script used by importer instance of webrunner
< = jinja2-template-executable
template = {{ parameter_dict['mariadb-resiliency-after-import-script'] }}
rendered = ${directory:bin}/restore-from-backup
recipe = slapos.recipe.template:jinja2
url = {{ parameter_dict['mariadb-resiliency-after-import-script'] }}
output = ${directory:bin}/restore-from-backup
context =
key dash dash:dash
key mysql_executable binary-wrap-mysql:wrapper-path
......@@ -302,7 +294,7 @@ context =
key mariadb_backup_directory directory:mariadb-backup-full
key pid_file my-cnf-parameters:pid-file
key binlog_path my-cnf-parameters:binlog-path
key server_executable mysqld:rendered
key server_executable mysqld:output
[{{ section('monitor-generate-mariadb-slow-query-report') }}]
recipe = slapos.cookbook:cron.d
......@@ -311,14 +303,13 @@ name = generate-mariadb-slow-query-report
# The goal is to be executed before logrotate log rotation.
# Here, logrotate-entry-base:frequency = daily, so we run at 23 o'clock every day.
frequency = 0 23 * * *
command = ${monitor-generate-mariadb-slow-query-report-wrapper:rendered}
command = ${monitor-generate-mariadb-slow-query-report-wrapper:output}
[monitor-generate-mariadb-slow-query-report-wrapper]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['mariadb-slow-query-report-script'] }}
rendered = ${directory:bin}/${:filename}
url = {{ parameter_dict['mariadb-slow-query-report-script'] }}
output = ${directory:bin}/${:filename}
filename = generate-mariadb-slow-query-report
mode = 755
context =
raw slow_query_path ${directory:srv}/backup/logrotate/mariadb_slowquery.log
raw pt_query_exec ${binary-wrap-pt-digest:wrapper-path}
......
......@@ -16,7 +16,6 @@
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
mode = 644
[smtpd-password]
recipe = slapos.cookbook:generate.password
......@@ -61,10 +60,9 @@ var-spool-postfix-trace = ${:var-spool-postfix}/trace
# webrunner resiliency with erp5 inside.
[{{ section("resiliency-exclude-file") }}]
# Generate rdiff exclude file
recipe = slapos.recipe.template:jinja2
mode = 644
template = {{ 'inline:{{ "**\\n" }}' }}
rendered = ${directory:srv}/exporter.exclude
recipe = slapos.recipe.template
inline = {{ '{{ "**\\n" }}' }}
output = ${directory:srv}/exporter.exclude
{% if divert -%}
{% set milter_port = tcpv4_port + 1 -%}
......@@ -100,21 +98,20 @@ recipe = slapos.cookbook:userinfo
[smtp-sasl-passwd]
< = jinja2-template-base
rendered = ${directory:etc-postfix}/sasl_passwd
output = ${directory:etc-postfix}/sasl_passwd
{% if relay -%}
template = inline:{{ "{{ host }} {{ sasl_credential }}" }}
inline ={{ "{{ host }} {{ sasl_credential }}" }}
{%- else -%}
template = inline:
inline =
{%- endif %}
context =
key host configuration:relayhost
key sasl_credential configuration:relay-sasl-credential
mode = 600
[{{ section('cyrus-smtpd-conf') }}]
< = jinja2-template-base
rendered = ${directory:etc-cyrus}/smtpd.conf
template = inline:
output = ${directory:etc-cyrus}/smtpd.conf
inline =
pwcheck_method: auxprop
mech_list: PLAIN LOGIN
sasldb_path: {{ '{{ sasldb }}' }}
......@@ -146,8 +143,8 @@ update =
[{{ section('postfix-main-cf') }}]
< = jinja2-template-base
rendered = ${directory:etc-postfix}/main.cf
template = {{ parameter_dict['template-postfix-main-cf'] }}
output = ${directory:etc-postfix}/main.cf
url = {{ parameter_dict['template-postfix-main-cf'] }}
context =
key bin_directory directory:bin
key usr_directory directory:usr
......@@ -169,21 +166,21 @@ context =
[{{ section('postfix-master-cf') }}]
< = jinja2-template-base
rendered = ${directory:etc-postfix}/master.cf
template = {{ parameter_dict['template-postfix-master-cf'] }}
output = ${directory:etc-postfix}/master.cf
url = {{ parameter_dict['template-postfix-master-cf'] }}
context = key smtp configuration:smtp
[aliases]
< = jinja2-template-base
template = {{ parameter_dict['template-postfix-aliases'] }}
rendered = ${directory:etc-postfix}/aliases
url = {{ parameter_dict['template-postfix-aliases'] }}
output = ${directory:etc-postfix}/aliases
context =
key alias_dict configuration:alias-dict
[typed-paths]
# Postfix-friendly rendering of file paths, prefixed with database type.
aliases = hash:${aliases:rendered}
smtp-sasl-passwd = hash:${smtp-sasl-passwd:rendered}
aliases = hash:${aliases:output}
smtp-sasl-passwd = hash:${smtp-sasl-passwd:output}
[{{ section('postalias-db') }}]
recipe = plone.recipe.command
......
......@@ -109,10 +109,9 @@ command = ${tidstorage:repozo-wrapper}
# webrunner resiliency with erp5 inside.
[{{ section("resiliency-exclude-file") }}]
# Generate rdiff exclude file
recipe = slapos.recipe.template:jinja2
mode = 644
template = {{ 'inline:{{ "${directory:zodb}/**\\n${directory:log}/**\\n" }}' }}
rendered = ${directory:srv}/exporter.exclude
recipe = slapos.recipe.template
inline = {{ '{{ "${directory:zodb}/**\\n${directory:log}/**\\n" }}' }}
output = ${directory:srv}/exporter.exclude
[{{ section("resiliency-identity-signature-script")}}]
# Generate identity script used by webrunner to check data integrity
......
......@@ -52,7 +52,6 @@ partition. No more (undefined result), no less (IndexError).
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
mode = 644
[run-common]
<= userhosts-wrapper-base
......@@ -66,7 +65,7 @@ environment +=
MATPLOTLIBRC={{ parameter_dict['matplotlibrc'] }}
INSTANCE_HOME=${:instance-home}
CAUCASE={{ slapparameter_dict['caucase-url'] }}
FONTCONFIG_FILE=${fontconfig-conf:rendered}
FONTCONFIG_FILE=${fontconfig-conf:output}
{% if slapparameter_dict.get('wendelin-core-zblk-fmt') %}
WENDELIN_CORE_ZBLK_FMT={{ slapparameter_dict['wendelin-core-zblk-fmt'] }}
{% endif %}
......@@ -107,8 +106,8 @@ fontconfig-cache = ${buildout:directory}/.fontconfig
[fontconfig-conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-fonts-conf'] }}
rendered = ${directory:etc}/fonts.conf
url = {{ parameter_dict['template-fonts-conf'] }}
output = ${directory:etc}/fonts.conf
context =
key cachedir directory:fontconfig-cache
key fonts :fonts
......@@ -127,9 +126,8 @@ includes =
[{{ section("resiliency-exclude-file") }}]
# Generate rdiff exclude file
recipe = slapos.recipe.template:jinja2
mode = 644
template = {{ 'inline:{{ "${directory:log}/**\\n${directory:tmp}/**\\n" }}' }}
rendered = ${directory:srv}/exporter.exclude
inline = {{ '{{ "${directory:log}/**\\n${directory:tmp}/**\\n" }}' }}
output = ${directory:srv}/exporter.exclude
[{{ section("resiliency-identity-signature-script")}}]
# Generate identity script used by webrunner to check data integrity
......@@ -168,38 +166,38 @@ hostalias-dict = {{ dumps(slapparameter_dict['hostalias-dict']) }}
[hostaliases]
< = jinja2-template-base
template = inline: {{ '
inline = {{ '
{% for alias, aliased in host_dict.items() -%}
{{ alias }} {{ aliased }}
{% endfor %}
' }}
rendered = ${directory:etc}/hostaliases
output = ${directory:etc}/hostaliases
context = key host_dict hosts-parameter:hostalias-dict
[hosts]
< = jinja2-template-base
template = inline: {{ '
inline = {{ '
{% for alias, aliased in host_dict.items() -%}
{{ aliased }} {{ alias }}
{% endfor %}
' }}
rendered = ${directory:etc}/hosts
output = ${directory:etc}/hosts
context = key host_dict hosts-parameter:host-dict
[userhosts-bin]
recipe = slapos.recipe.template:jinja2
mode = 755
template = inline:#!{{ parameter_dict['dash'] }}/bin/dash
export HOSTS_FILE=${hosts:rendered}
inline =
#!{{ parameter_dict['dash'] }}/bin/dash
export HOSTS_FILE=${hosts:output}
export LD_PRELOAD={{ parameter_dict['userhosts'] }}:$LD_PRELOAD
exec "$@"
rendered = ${directory:bin}/userhosts
output = ${directory:bin}/userhosts
[userhosts-wrapper-base]
recipe = slapos.cookbook:wrapper
environment =
HOSTALIASES=${hostaliases:rendered}
command-line = '${userhosts-bin:rendered}' ${:wrapped-command-line}
HOSTALIASES=${hostaliases:output}
command-line = '${userhosts-bin:output}' ${:wrapped-command-line}
{# Hack to deploy SSL certs via instance parameters -#}
{% for zodb in six.itervalues(zodb_dict) -%}
......@@ -211,8 +209,8 @@ command-line = '${userhosts-bin:rendered}' ${:wrapped-command-line}
{% if k in storage_dict -%}
[{{ section('neo-ssl-' + k[1:]) }}]
< = jinja2-template-base
rendered = ${directory:etc}/{{v}}
template = inline:{{'{{'}}pem}}
output = ${directory:etc}/{{v}}
inline ={{'{{'}}pem}}
context = key pem :pem
pem = {{dumps(storage_dict.pop(k))}}
......@@ -242,10 +240,9 @@ file-list = {{ parameter_dict['site-zcml'] }}
[{{ section('zope-inituser') }}]
< = jinja2-template-base
rendered = ${directory:instance}/inituser
template = inline:{{ slapparameter_dict['inituser-login'] }}:{SHA}{{ base64.b64encode(hashlib.sha1(slapparameter_dict['inituser-password'].encode('utf-8')).digest()) }}
mode = 600
once = ${:rendered}_done
output = ${directory:instance}/inituser
inline ={{ slapparameter_dict['inituser-login'] }}:{SHA}{{ base64.b64encode(hashlib.sha1(slapparameter_dict['inituser-password'].encode('utf-8')).digest()) }}
once = ${:output}_done
[zope-conf-parameter-base]
ip = {{ ipv4 }}
......@@ -289,7 +286,7 @@ timerserver-interval = {{ dumps(timerserver_interval) }}
[zope-conf-base]
< = jinja2-template-base
template = {{ parameter_dict['zope-conf-template'] }}
url = {{ parameter_dict['zope-conf-template'] }}
extensions =
jinja2.ext.do
jinja2.ext.loopcontrols
......@@ -339,7 +336,7 @@ longrequest-logger-file =
[{{ conf_name }}]
< = zope-conf-base
rendered = ${directory:etc}/{{ name }}.conf
output = ${directory:etc}/{{ name }}.conf
context =
section parameter_dict {{ conf_parameter_name }}
import os os
......@@ -348,7 +345,7 @@ context =
[{{ section(name) }}]
< = runzope-base
wrapper-path = ${directory:service-on-watch}/{{ name }}
configuration-file = {{ '${' ~ conf_name ~ ':rendered}' }}
configuration-file = {{ '${' ~ conf_name ~ ':output}' }}
{%- if wsgi %}
port = {{ port }}
{%- endif %}
......@@ -438,9 +435,8 @@ bin-path = {{ bin_directory }}/{{ parameter_dict['egg-interpreter'] }}
[{{ section('test-zelenium-runner') }}]
<= jinja2-template-base
template = {{ parameter_dict['run-zelenium-template'] }}
rendered = ${directory:bin}/runTestSuite
mode = 755
url = {{ parameter_dict['run-zelenium-template'] }}
output = ${directory:bin}/runTestSuite
context =
import json_module json
key configuration test-zelenium-runner-parameter:configuration
......@@ -477,7 +473,7 @@ environment-extra =
REAL_INSTANCE_HOME=${:instance-home}
SQLBENCH_PATH={{ parameter_dict['sqlbench_path'] }}
TEST_CA_PATH=${directory:ca-dir}
ERP5_TEST_RUNNER_CONFIGURATION=${test-runner-configuration:rendered}
ERP5_TEST_RUNNER_CONFIGURATION=${test-runner-configuration:output}
{%- if wsgi %}
erp5_wsgi=1
{%- endif %}
......@@ -498,8 +494,8 @@ command-line =
[test-runner-configuration]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/${:_buildout_section_name_}.json
template = inline:
output = ${directory:etc}/${:_buildout_section_name_}.json
inline =
{{ json.dumps(slapparameter_dict['test-runner-configuration']) }}
[{{ section('runUnitTest') }}]
......
......@@ -2,9 +2,6 @@
extends =
{{ instance_common_cfg }}
[jinja2-template-base]
mode = 644
[default-dynamic-template-parameters]
bin-directory = {{ bin_directory }}
buildout-bin-directory = {{ buildout_bin_directory }}
......@@ -21,7 +18,7 @@ template-postfix-master-cf = {{ template_postfix_master_cf }}
[dynamic-template-postfix]
< = jinja2-template-base
template = {{ template_postfix }}
url = {{ template_postfix }}
filename = instance-postfix.cfg
extensions = jinja2.ext.do
extra-context =
......@@ -41,7 +38,7 @@ template-zodb-base = {{ template_zodb_base }}
[dynamic-template-erp5]
<= jinja2-template-base
template = {{ template_erp5 }}
url = {{ template_erp5 }}
filename = instance-erp5.cfg
extra-context =
key default_cloudooo_url dynamic-template-erp5-parameters:default-cloudooo-url
......@@ -74,7 +71,7 @@ template-apache-conf = {{ template_apache_conf }}
[dynamic-template-balancer]
<= jinja2-template-base
template = {{ template_balancer }}
url = {{ template_balancer }}
filename = instance-balancer.cfg
extra-context =
section parameter_dict dynamic-template-balancer-parameters
......@@ -89,7 +86,7 @@ import-list =
[dynamic-template-zeo]
<= jinja2-template-base
template = {{ template_zeo }}
url = {{ template_zeo }}
filename = instance-zeo.cfg
extra-context =
key buildout_directory buildout:directory
......@@ -120,7 +117,7 @@ egg-interpreter = {{egg_interpreter}}
[dynamic-template-zope]
<= jinja2-template-base
template = {{ template_zope }}
url = {{ template_zope }}
filename = instance-zope.cfg
extra-context =
key buildout_directory buildout:directory
......@@ -144,7 +141,7 @@ logrotate-location = {{ logrotate_location }}
[dynamic-template-kumofs]
<= jinja2-template-base
template = {{ template_kumofs }}
url = {{ template_kumofs }}
filename = instance-kumofs.cfg
extra-context =
section parameter_dict dynamic-template-kumofs-parameters
......@@ -174,7 +171,7 @@ groonga-plugins-path = {{ groonga_plugin_dir }}:{{ groonga_mysql_normalizer_plug
[dynamic-template-mariadb]
<= jinja2-template-base
template = {{ template_mariadb }}
url = {{ template_mariadb }}
filename = instance-mariadb.cfg
extra-context =
section parameter_dict dynamic-template-mariadb-parameters
......@@ -196,11 +193,11 @@ mode = 644
# we need this value to be present in a section,
# for slapos.cookbook:switch-softwaretype to work
[dynamic-template-jupyter]
rendered = {{ template_jupyter_cfg }}
output = {{ template_jupyter_cfg }}
[dynamic-template-wcfs]
<= jinja2-template-base
template = {{ instance_wcfs_cfg_in }}
url = {{ instance_wcfs_cfg_in }}
filename = instance_wcfs.cfg
extra-context =
section parameter_dict dynamic-template-zope-parameters
......@@ -212,20 +209,20 @@ recipe = slapos.cookbook:switch-softwaretype
override = {{ dumps(override_switch_softwaretype |default) }}
# Public software types
default = dynamic-template-erp5:rendered
default = dynamic-template-erp5:output
# BBB
RootSoftwareInstance = ${:default}
# Internal software types
kumofs = dynamic-template-kumofs:rendered
caucase = dynamic-template-caucase:rendered
mariadb = dynamic-template-mariadb:rendered
balancer = dynamic-template-balancer:rendered
postfix = dynamic-template-postfix:rendered
zodb-zeo = dynamic-template-zeo:rendered
zodb-neo = neo:rendered
zope = dynamic-template-zope:rendered
jupyter = dynamic-template-jupyter:rendered
wcfs = dynamic-template-wcfs:rendered
kumofs = dynamic-template-kumofs:output
caucase = dynamic-template-caucase:output
mariadb = dynamic-template-mariadb:output
balancer = dynamic-template-balancer:output
postfix = dynamic-template-postfix:output
zodb-zeo = dynamic-template-zeo:output
zodb-neo = neo:output
zope = dynamic-template-zope:output
jupyter = dynamic-template-jupyter:output
wcfs = dynamic-template-wcfs:output
# Keep cloudooo backward compatibility
cloudooo = dynamic-template-legacy:output
......
......@@ -56,9 +56,8 @@ part-list =
[instance]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/instance.cfg
template = ${:_profile_base_location_}/${:filename}
mode = 0644
output = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
context =
key application_location application:location
key application_deployment_part_list custom-application-deployment:part-list
......@@ -73,10 +72,10 @@ context =
key dash_location dash:location
key findutils_location findutils:location
key logrotate_location logrotate:location
key logrotate_cfg template-logrotate-base:rendered
key logrotate_cfg template-logrotate-base:output
key gzip_location gzip:location
key xz_utils_location xz-utils:location
key template_monitor monitor2-template:rendered
key template_monitor monitor2-template:output
key mariadb_link_binary template-mariadb:link-binary
key mariadb_location mariadb:location
key mariadb_resiliency_after_import_script mariadb-resiliency-after-import-script:target
......@@ -93,7 +92,7 @@ context =
key template_lamp instance-lamp:target
key template_mariadb template-mariadb:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_mysqld_wrapper template-mysqld-wrapper:rendered
key template_mysqld_wrapper template-mysqld-wrapper:output
key template_my_cnf template-my-cnf:target
key unixodbc_location unixodbc:location
key openssl_location openssl:location
......@@ -113,7 +112,7 @@ context =
[erp5]
# lamp stack reuses erp5 stack to have mariadb, but we don't need to checkout erp5 here.
recipe =
recipe =
location = ${buildout:parts-directory}/${:_buildout_section_name_}
......
......@@ -14,11 +14,11 @@
# not need these here).
[instance]
filename = instance.cfg.in
md5sum = e4e070f93adaf917f9427ae9f35573d9
md5sum = 29df0dc24386ecb97dc52c9fb59108c8
[instance-apache-php]
filename = instance-apache-php.cfg.in
md5sum = e7a14c01e6314e2bffebd7d80cf1c488
md5sum = 0952ef9f6cb5e259ad5519d2975d2f37
[instance-lamp]
filename = instance-lamp.cfg.jinja2.in
......
......@@ -135,17 +135,16 @@ apache-config-dir = ${directory:apache.d}
[apache-php-conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-apache-conf'] }}
rendered = ${directory:etc}/apache.conf
context =
url = {{ parameter_dict['template-apache-conf'] }}
output = ${directory:etc}/apache.conf
context =
section parameter_dict apache-php-configuration
extensions = jinja2.ext.do
mode = 0644
[apache-php-wrapper]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/apache-wrapper
command-line = "{{ parameter_dict['apache-location'] }}/bin/httpd" -f "${apache-php-conf:rendered}" -DFOREGROUND
command-line = "{{ parameter_dict['apache-location'] }}/bin/httpd" -f "${apache-php-conf:output}" -DFOREGROUND
wait-for-files =
${ca-directory:certs}/httpd.crt
${ca-directory:certs}/httpd.key
......@@ -171,13 +170,12 @@ php-upload-dir = ${directory:upload-tmp}
[php.ini-conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-php-ini'] }}
rendered = ${directory:php-ini-dir}/php.ini
context =
url = {{ parameter_dict['template-php-ini'] }}
output = ${directory:php-ini-dir}/php.ini
context =
section parameter_dict php.ini-configuration
section instance_dict instance-parameter
extensions = jinja2.ext.do
mode = 0644
[instance-parameter]
db-user = ${mariadb-urlparse:username}
......@@ -188,7 +186,7 @@ db-port = ${mariadb-urlparse:port}
document-root = ${apache-php-configuration:document-root}
backend-url = ${apache-php-configuration:url}
php-bin = {{ parameter_dict['apache-php-location'] }}/bin/php
php-ini = ${php.ini-conf:rendered}
php-ini = ${php.ini-conf:output}
#----------------
......
......@@ -9,10 +9,10 @@ offline = true
[switch_softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-template-lamp:rendered
default = dynamic-template-lamp:output
RootSoftwareInstance = ${:default}
mariadb = dynamic-template-mariadb:rendered
apache = dynamic-template-apache-php:rendered
mariadb = dynamic-template-mariadb:output
apache = dynamic-template-apache-php:output
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
......@@ -24,9 +24,8 @@ cert = ${slap-connection:cert-file}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
output = ${buildout:directory}/${:filename}
extensions = jinja2.ext.do
mode = 0644
extra-context =
context =
key develop_eggs_directory buildout:develop-eggs-directory
......@@ -46,7 +45,7 @@ context =
[dynamic-template-lamp]
<= jinja2-template-base
template = {{ template_lamp }}
url = {{ template_lamp }}
filename = template-lamp.cfg
extra-context =
section parameter_dict dynamic-template-lamp-parameters
......@@ -65,7 +64,7 @@ custom-application-template = {{ custom_application_template }}
[dynamic-template-apache-php]
<= jinja2-template-base
template = {{ template_apache_php }}
url = {{ template_apache_php }}
filename = template-apache-php.cfg
extra-context =
key custom_application_template application-parameters:custom-application-template
......@@ -97,7 +96,7 @@ bin-directory = {{ bin_directory }}
[dynamic-template-mariadb]
<= jinja2-template-base
template = {{ template_mariadb }}
url = {{ template_mariadb }}
filename = instance-mariadb.cfg
extra-context =
key ipv4_set slap-configuration:ipv4
......
......@@ -19,8 +19,8 @@ url = ${:_profile_base_location_}/${:filename}
[template-logrotate-base]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/instance-logrotate-base.cfg
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance-logrotate-base.cfg
context =
key dcron_location dcron:location
key xz_location xz-utils:location
......
......@@ -22,4 +22,4 @@ md5sum = ce6ccdd52148770149e6e7525ab71e80
[template-logrotate-base]
filename = instance-logrotate-base.cfg.in
md5sum = 8a774b677623c77c6ff0b88852fac643
md5sum = ed807da528595b7111c19e09056b01ce
......@@ -34,8 +34,8 @@ logrotate-entries = ${logrotate-directory:logrotate-entries}
[logrotate-conf]
recipe = slapos.recipe.template:jinja2
template = {{ logrotate_conf_template }}
rendered = ${logrotate-directory:etc}/logrotate.conf
url = {{ logrotate_conf_template }}
output = ${logrotate-directory:etc}/logrotate.conf
context =
section parameter_dict logrotate-conf-parameter
......@@ -48,8 +48,8 @@ context =
# - "pre" with commands to execute before rotation
# - "backup" with directory where to store logs
recipe = slapos.recipe.template:jinja2
template = {{ logrotate_entry_template }}
rendered = ${logrotate-conf-parameter:logrotate-entries}/${:name}
url = {{ logrotate_entry_template }}
output = ${logrotate-conf-parameter:logrotate-entries}/${:name}
context =
key backup :backup
key log :log
......@@ -69,7 +69,7 @@ delaycompress = true
[logrotate]
recipe = slapos.cookbook:wrapper
command-line = {{ logrotate_location }}/sbin/logrotate -s "${logrotate-directory:srv}/logrotate.status" "${logrotate-conf:rendered}"
command-line = {{ logrotate_location }}/sbin/logrotate -s "${logrotate-directory:srv}/logrotate.status" "${logrotate-conf:output}"
wrapper-path = ${logrotate-directory:bin}/logrotate
[cron-entry-logrotate]
......
......@@ -21,7 +21,7 @@ Extend monitor template and a monitor-base to parts:
[buildout]
extends =
${monitor-template:rendered}
${monitor-template:output}
parts =
...
monitor-base
......@@ -77,7 +77,7 @@ If you have sub-instances, you should collect the base monitor url from all inst
Also, all monitors of the sub instances need to have same password as the password of the root instance monitor.
NB: You should use double $ (ex: $${monitor-template:rendered}) instead of one $ in your instance template file if it's not a jinja template. See:
NB: You should use double $ (ex: $${monitor-template:output}) instead of one $ in your instance template file if it's not a jinja template. See:
- Jinja template file exemple, use one $: https://lab.nexedi.com/nexedi/slapos/blob/master/software/slaprunner/instance-resilient-test.cfg.jinja2
- Non Jinja template file, use $$: https://lab.nexedi.com/nexedi/slapos/blob/master/software/slaprunner/instance.cfg
......
......@@ -53,19 +53,17 @@ filename = monitor.conf.in
filename = httpd-cors.cfg.in
# End templates files
# XXX keep compatibility (with software/ipython_notebook/software.cfg )
[monitor-template]
rendered = ${monitor2-template:rendered}
output = ${monitor2-template:rendered}
output = ${monitor2-template:output}
[monitor2-template]
recipe = slapos.recipe.template:jinja2
filename = template-monitor.cfg
template = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in
rendered = ${buildout:directory}/template-monitor.cfg
url = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in
output = ${buildout:directory}/template-monitor.cfg
context =
key apache_location apache:location
key template_logrotate_base template-logrotate-base:rendered
key template_logrotate_base template-logrotate-base:output
key randomsleep randomsleep:output
raw monitor_bin ${buildout:bin-directory}/monitor.bootstrap
raw monitor_collect ${buildout:bin-directory}/monitor.collect
......
......@@ -14,7 +14,7 @@
# not need these here).
[monitor2-template]
filename = instance-monitor.cfg.jinja2.in
md5sum = fb10eabe010d136764365c7df2993814
md5sum = 7e7b964f324d803d40112e88cc8d75d8
[monitor-httpd-conf]
_update_hash_filename_ = templates/monitor-httpd.conf.in
......
......@@ -124,8 +124,8 @@ software-type = ${slap-configuration:slap-software-type}
[monitor-conf]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_conf_template }}
rendered = ${directory:etc}/${:filename}
url = {{ monitor_conf_template }}
output = ${directory:etc}/${:filename}
filename = monitor.conf
context = section parameter_dict monitor-conf-parameters
section promise_parameter_dict monitor-promise-conf
......@@ -133,7 +133,7 @@ context = section parameter_dict monitor-conf-parameters
[start-monitor]
recipe = slapos.cookbook:wrapper
command-line = {{ monitor_bin }} -c ${monitor-conf:rendered}
command-line = {{ monitor_bin }} -c ${monitor-conf:output}
name = bootstrap-monitor
wrapper-path = ${directory:scripts}/${:name}
......@@ -169,40 +169,37 @@ cert-file = ${ca-directory:certs}/monitor-httpd.crt
key-file = ${ca-directory:certs}/monitor-httpd.key
htpasswd-file = ${httpd-monitor-htpasswd:htpasswd-path}
url = https://[${monitor-instance-parameter:monitor-httpd-ipv6}]:${:port}
httpd-cors-config-file = ${monitor-httpd-cors:rendered}
httpd-cors-config-file = ${monitor-httpd-cors:output}
httpd-include-file =
[monitor-httpd-conf]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_httpd_template }}
rendered = ${monitor-directory:etc}/monitor-httpd.conf
mode = 0744
url = {{ monitor_httpd_template }}
output = ${monitor-directory:etc}/monitor-httpd.conf
context =
section directory monitor-directory
section parameter_dict monitor-httpd-conf-parameter
[monitor-httpd-cors]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_https_cors }}
rendered = ${directory:etc}/httpd-cors.cfg
mode = 0600
url = {{ monitor_https_cors }}
output = ${directory:etc}/httpd-cors.cfg
context =
key domain monitor-instance-parameter:cors-domains
[monitor-httpd-wrapper]
recipe = slapos.cookbook:wrapper
command-line = {{ apache_location }}/bin/httpd -f ${monitor-httpd-conf:rendered} -DFOREGROUND
command-line = {{ apache_location }}/bin/httpd -f ${monitor-httpd-conf:output} -DFOREGROUND
wrapper-path = ${directory:bin}/monitor-httpd
wait-for-files =
${monitor-httpd-conf-parameter:key-file}
${monitor-httpd-conf-parameter:cert-file}
${monitor-httpd-graceful-wrapper:rendered}
${monitor-httpd-graceful-wrapper:output}
[monitor-httpd-graceful-wrapper]
recipe = slapos.recipe.template:jinja2
template = {{ template_wrapper }}
rendered = ${directory:scripts}/monitor-httpd-graceful
mode = 0700
url = {{ template_wrapper }}
output = ${directory:scripts}/monitor-httpd-graceful
context =
key content :command
raw dash_binary {{ dash_executable_location }}
......@@ -224,7 +221,7 @@ mode = 700
[monitor-globalstate-wrapper]
recipe = slapos.cookbook:wrapper
command-line = ${xnice-bin:output} {{ monitor_genstatus }} '${monitor-conf:rendered}'
command-line = ${xnice-bin:output} {{ monitor_genstatus }} '${monitor-conf:output}'
wrapper-path = ${directory:bin}/monitor-globalstate
[monitor-configurator-wrapper]
......@@ -288,7 +285,6 @@ input = inline:${:log} {
notifempty
}
output = ${logrotate-directory:logrotate-entries}/${:name}
mode = 600
[logrotate-entry-monitor-promise-history]
<= logrotate-entry-base
......
......@@ -18,9 +18,9 @@
#
# [instance.cfg]
# <= jinja2-template
# template = inline:
# inline =
# [buildout]
# extends = ${nxdtest-instance.cfg:rendered}
# extends = ${nxdtest-instance.cfg:output}
#
# [runTestSuite]
# env.sh = ...
......@@ -37,15 +37,15 @@ extends =
[jinja2-template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/${:_buildout_section_name_}
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:_buildout_section_name_}
mode = 0644
context =
section buildout buildout
[nxdtest-instance.cfg]
<= jinja2-template
template = ${:_profile_base_location_}/nxdtest/${:filename}
url = ${:_profile_base_location_}/nxdtest/${:filename}
# NOTE += does not work
context =
section buildout buildout
......
......@@ -162,14 +162,12 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/mariadb/instance-mariadb-import.cfg.in
output = ${buildout:directory}/instance-mariadb-import.cfg
md5sum = ...
mode = 0644
[instance-mariadb-export]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/mariadb/instance-mariadb-export.cfg.in
output = ${buildout:directory}/instance-mariadb-export.cfg
md5sum = ...
mode = 0644
......
......@@ -14,19 +14,19 @@
# not need these here).
[pbsready]
filename = pbsready.cfg.in
md5sum = 1d3aba1ba770ad3fcc2ab6c0b9266409
md5sum = e24d0567cda7c72e39f6c8fcb0ede7ab
[pbsready-import]
filename = pbsready-import.cfg.in
md5sum = a211e1a7e97ced47b8f011af806b351f
md5sum = 0aa7feb615fc5ac1a132a6d92c80f954
[pbsready-export]
filename = pbsready-export.cfg.in
md5sum = 8f15263c4a27ec315eb3a12dbf7a7b34
md5sum = 2ef471242ab1fe9d0998f49304bfa066
[template-pull-backup]
filename = instance-pull-backup.cfg.in
md5sum = d1af7f8a5d4f0846e4c016253fa31f3d
md5sum = 44a3166048a81d0d76d69527b1934ef7
[template-replicated]
filename = template-replicated.cfg.in
......@@ -38,7 +38,7 @@ md5sum = 071b1034ee8f5cc14f79b16fdeba2813
[template-resilient-templates]
filename = template-resilient-templates.cfg.in
md5sum = 604b9d160ab85ec80718a2c54df2c4b7
md5sum = 3c31d446c762f8333283dbee84bb4a9c
[instance-frozen]
filename = instance-frozen.cfg.in
......
......@@ -17,8 +17,8 @@ parts =
monitor-check-resilient-feed-file
extends =
${monitor2-template:rendered}
${template-logrotate-base:rendered}
${monitor2-template:output}
${template-logrotate-base:output}
#----------------
#--
......@@ -81,10 +81,9 @@ ip = $${notifier:host}
# notifier.notify.callback sets up a callback
[notifier]
recipe = slapos.recipe.template:jinja2
template = ${template-wrapper:output}
rendered = $${:wrapper}
url = ${template-wrapper:output}
output = $${:wrapper}
wrapper = $${basedirectory:services}/notifier
mode = 0700
command = ${buildout:bin-directory}/pubsubserver --callbacks $${directory:notifier-callbacks} --feeds $${directory:notifier-feeds} --equeue-socket $${equeue:socket} --logfile $${basedirectory:log}/notifier.log $${:host} $${:port}
host = {{ ipv6 }}
port = $${notifier-port:port}
......@@ -223,9 +222,8 @@ config-command = $${pull-push-stalled-promise-bin:wrapper-path}
[notifier-feed-status-promise-bin]
recipe = slapos.recipe.template:jinja2
template = ${notifier-feed-promise-template:target}
rendered = $${rootdirectory:bin}/notifier-feed-check-malformed-or-failure.py
mode = 700
url = ${notifier-feed-promise-template:target}
output = $${rootdirectory:bin}/notifier-feed-check-malformed-or-failure.py
context =
key notifier_feed_directory directory:notifier-feeds
raw base_url http://[$${notifier:host}]:$${notifier:port}/get/
......@@ -235,7 +233,7 @@ context =
<= monitor-promise-base
promise = check_command_execute
name = notifier-feed-check-malformed-or-failure.py
config-command = $${notifier-feed-status-promise-bin:rendered}
config-command = $${notifier-feed-status-promise-bin:output}
#----------------
#--
......@@ -264,15 +262,14 @@ username = {{ slapparameter_dict.get('monitor-username', 'admin') }}
password = {{ slapparameter_dict.get('monitor-password', '$${monitor-htpasswd:passwd}') }}
[monitor-conf-parameters]
private-path-list +=
private-path-list +=
$${logrotate-directory:logrotate-backup}
$${basedirectory:log}
[monitor-check-resilient-feed-file]
recipe = slapos.recipe.template:jinja2
template = ${template-monitor-check-resilient-feed:target}
rendered = $${monitor-directory:bin}/check-create-resilient-feed-files
mode = 700
url = ${template-monitor-check-resilient-feed:target}
output = $${monitor-directory:bin}/check-create-resilient-feed-files
context =
key input_feed_directory directory:notifier-feeds
key monitor_feed_directory monitor-directory:public
......
......@@ -44,25 +44,24 @@ pidfile = ${resilient-directory:pid}/${:name}.pid
max-run = 3
[logrotate-entry-notifier]
rendered = ${rootdirectory:etc}/logrotate_notifier.conf
output = ${rootdirectory:etc}/logrotate_notifier.conf
[notifier-exporter-promise-bin]
recipe = slapos.recipe.template:jinja2
mode = 700
template = inline:
recipe = slapos.recipe.template
inline =
#!{{ bash_executable_location }}
EXPORTER_FEED="${notifier-exporter:log-file}"
FAILURE_PATTERN="FAILURE"
if [ -s "$EXPORTER_FEED" ]; then
tail -n 1 $EXPORTER_FEED | grep -vq FAILURE_PATTERN
fi
rendered = ${rootdirectory:bin}/exporter-status
output = ${rootdirectory:bin}/exporter-status
[notifier-exporter-promise]
<= monitor-promise-base
promise = check_command_execute
name = exporter-status.py
config-command = ${notifier-exporter-promise-bin:rendered}
config-command = ${notifier-exporter-promise-bin:output}
[cron-entry-backup]
# Schedule the periodic database dump.
......@@ -76,7 +75,7 @@ frequency = {{ resiliency_backup_periodicity }}
{% else %}
time = ${publish-early:resiliency-backup-periodicity}
{% endif %}
command = {{ logrotate_executable_location }} -s ${basedirectory:run}/logrotate.status ${logrotate-entry-notifier:rendered}; ${notifier-exporter:wrapper} --transaction-id `date +%s`
command = {{ logrotate_executable_location }} -s ${basedirectory:run}/logrotate.status ${logrotate-entry-notifier:output}; ${notifier-exporter:wrapper} --transaction-id `date +%s`
[gen-resiliency-backup-periodicity]
recipe = slapos.cookbook:random.time
......
......@@ -62,8 +62,8 @@ output = $${rootdirectory:bin}/post-notification-run
mode = 0700
[backup-checksum-integrity-promise-bin]
recipe = slapos.recipe.template:jinja2
template = inline:
recipe = slapos.recipe.template
inline =
#!/${bash:location}/bin/bash
backup_diff_file=$${post-notification-run:diff-file}
if [ -f "$backup_diff_file" ]; then
......@@ -76,14 +76,13 @@ template = inline:
# If file doesn't exist, promise shouldnt raise false positive
exit 0;
fi
rendered = $${rootdirectory:bin}/backup-checksum-integrity
mode = 700
output = $${rootdirectory:bin}/backup-checksum-integrity
[backup-checksum-integrity-promise]
<= monitor-promise-base
promise = check_command_execute
name = backup-checksum-integrity.py
config-command = $${backup-checksum-integrity-promise-bin:rendered}
config-command = $${backup-checksum-integrity-promise-bin:output}
###########
......
......@@ -20,7 +20,7 @@ parts +=
extends =
${monitor2-template:rendered}
${monitor2-template:output}
[slap-network-information]
local-ipv4 = $${slap-configuration:ipv4-random}
......@@ -123,10 +123,9 @@ equeue-binary = ${buildout:bin-directory}/equeue
# notifier.notify.callback sets up a callback
[notifier]
recipe = slapos.recipe.template:jinja2
template = ${template-wrapper:output}
rendered = $${:wrapper}
url = ${template-wrapper:output}
output = $${:wrapper}
wrapper = $${basedirectory:services}/notifier
mode = 0700
feeds = $${directory:notifier-feeds}
callbacks-directory = $${directory:notifier-callbacks}
command = ${buildout:bin-directory}/pubsubserver --callbacks $${:callbacks-directory} --feeds $${:feeds} --equeue-socket $${equeue:socket} --logfile $${basedirectory:log}/notifier.log $${:host} $${:port}
......@@ -174,10 +173,10 @@ config-command = $${notifier-stalled-promise-bin:wrapper-path}
#-- OpenSSH.
[resilient-sshd-config]
# XXX: Add timeout support
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/resilient-sshd.conf
recipe = slapos.recipe.template
output = $${directory:etc}/resilient-sshd.conf
path_pid = $${directory:run}/resilient-sshd.pid
template = inline:
inline =
PidFile $${:path_pid}
Port $${sshd-port:port}
ListenAddress $${slap-network-information:global-ipv6}
......@@ -193,7 +192,7 @@ recipe = slapos.cookbook:wrapper
host = $${slap-network-information:global-ipv6}
rsa-keyfile = $${directory:ssh}/server_key.rsa
home = $${directory:ssh}
command-line = ${openssh:location}/sbin/sshd -D -e -f $${resilient-sshd-config:rendered}
command-line = ${openssh:location}/sbin/sshd -D -e -f $${resilient-sshd-config:output}
wrapper-path = $${rootdirectory:bin}/raw_sshd
[sshd-pbs-authorized-key]
......@@ -271,9 +270,8 @@ config-command = $${resilient-sshkeys-sshd-promise-bin:output}
[notifier-feed-status-promise-bin]
recipe = slapos.recipe.template:jinja2
template = ${notifier-feed-promise-template:target}
rendered = $${rootdirectory:bin}/notifier-feed-check-malformed-or-failure.py
mode = 700
url = ${notifier-feed-promise-template:target}
output = $${rootdirectory:bin}/notifier-feed-check-malformed-or-failure.py
context =
key notifier_feed_directory directory:notifier-feeds
raw base_url http://[$${notifier:host}]:$${notifier:port}/get/
......@@ -283,7 +281,7 @@ context =
<= monitor-promise-base
promise = check_command_execute
name = notifier-feed-check-malformed-or-failure.py
config-command = $${notifier-feed-status-promise-bin:rendered}
config-command = $${notifier-feed-status-promise-bin:output}
#----------------
#--
#-- Connection informations to re-use.
......
[template-pbsready]
recipe = slapos.recipe.template:jinja2
template = ${pbsready:output}
rendered = $${buildout:directory}/pbsready.cfg
url = ${pbsready:output}
output = $${buildout:directory}/pbsready.cfg
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
[template-pbsready-export]
recipe = slapos.recipe.template:jinja2
template = ${pbsready-export:target}
rendered = $${buildout:directory}/pbsready-exporter.cfg
mode = 640
url = ${pbsready-export:target}
output = $${buildout:directory}/pbsready-exporter.cfg
context =
key slapparameter_dict slap-configuration:configuration
raw pbsready_template_path $${template-pbsready:rendered}
raw pbsready_template_path $${template-pbsready:output}
raw bash_executable_location ${bash:location}/bin/bash
raw logrotate_executable_location ${logrotate:location}/usr/sbin/logrotate
[template-pbsready-import]
recipe = slapos.recipe.template:jinja2
template = ${pbsready-import:output}
rendered = $${buildout:directory}/pbsready-importer.cfg
url = ${pbsready-import:output}
output = $${buildout:directory}/pbsready-importer.cfg
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
raw pbsready_template_path $${template-pbsready:rendered}
raw pbsready_template_path $${template-pbsready:output}
[instance-frozen]
recipe = slapos.recipe.template:jinja2
template = ${instance-frozen:output}
rendered = $${buildout:directory}/template-frozen.cfg
url = ${instance-frozen:output}
output = $${buildout:directory}/template-frozen.cfg
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
[template-pull-backup]
recipe = slapos.recipe.template:jinja2
template = ${template-pull-backup:output}
rendered = $${buildout:directory}/template-pull-backup.cfg
url = ${template-pull-backup:output}
output = $${buildout:directory}/template-pull-backup.cfg
extensions = jinja2.ext.do
context =
key slave_instance_list slap-configuration:slave-instance-list
......
......@@ -14,7 +14,7 @@
# not need these here).
[supervisord-library]
_update_hash_filename_ = supervisord.jinja2.in
md5sum = 163c9f60e4ad3842162cbb11d771b7b8
md5sum = 5d4ef34e10d19fd726a75c9ee9a82b10
[supervisord-conf]
_update_hash_filename_ = supervisord.conf.in
......
......@@ -22,24 +22,24 @@ pid-file = ${controller-directory:run}/supervisord-{{ name }}.pid
[supervisord-controller-conf]
recipe = slapos.recipe.template:jinja2
template = {{ supervisord_conf }}
url = {{ supervisord_conf }}
context =
section parameter_dict controller-parameters
rendered = ${controller-directory:etc}/supervisord-{{ name }}.conf
output = ${controller-directory:etc}/supervisord-{{ name }}.conf
[supervisord-{{ name }}]
recipe = slapos.cookbook:wrapper
command-line = {{ buildout_bin_directory }}/supervisord -c ${supervisord-controller-conf:rendered} --nodaemon
command-line = {{ buildout_bin_directory }}/supervisord -c ${supervisord-controller-conf:output} --nodaemon
wrapper-path = ${directory:services}/supervisord-{{ name }}
{% if use_service_hash -%}
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
{% endif -%}
depends =
depends =
{{ '${' ~ name ~ '-bin:recipe}' }}
[{{ name }}-bin]
recipe = slapos.cookbook:wrapper
command-line = {{ buildout_bin_directory }}/supervisorctl -c ${supervisord-controller-conf:rendered}
command-line = {{ buildout_bin_directory }}/supervisorctl -c ${supervisord-controller-conf:output}
wrapper-path = ${directory:bin}/{{ name }}
{%- endmacro %}
......@@ -52,8 +52,8 @@ wrapper-path = ${directory:bin}/{{ name }}
[supervisord-{{ name }}]
recipe = slapos.recipe.template:jinja2
template = inline:[program:{{ parameter_dict['name'] }}]
recipe = slapos.recipe.template
inline =[program:{{ parameter_dict['name'] }}]
directory = ${buildout:directory}
command = {{ parameter_dict['command'] }}
process_name = {{ parameter_dict['name'] }}
......@@ -74,6 +74,6 @@ template = inline:[program:{{ parameter_dict['name'] }}]
stderr_logfile_backups = 1
environment = {{ parameter_dict['environment'] | join(',') }}
rendered = ${controller-directory:supervisord}/{{ name }}.conf
output = ${controller-directory:supervisord}/{{ name }}.conf
{%- endmacro %}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment