diff --git a/software/erp5/instance-varnish.cfg b/software/erp5/instance-varnish.cfg deleted file mode 100644 index d08d9de18109ea0db2429576cd6337ab959a3e40..0000000000000000000000000000000000000000 --- a/software/erp5/instance-varnish.cfg +++ /dev/null @@ -1,118 +0,0 @@ -[buildout] -parts = - publish-varnish-connection-information - varnish-instance - web-checker - cron - cron-entry-logrotate - cron-entry-web-checker - -eggs-directory = ${buildout:eggs-directory} -develop-eggs-directory = ${buildout:develop-eggs-directory} -offline = true - -[publish-varnish-connection-information] -recipe = slapos.cookbook:publishurl -url = http://$${varnish-instance:ip}:$${varnish-instance:server-port}/ - -[varnish-instance] -recipe = slapos.cookbook:generic.varnish - -# Network options -ip = $${slap-network-information:local-ipv4} -server-port = 6001 -manager-port = 6002 - -# Paths: Running wrappers -varnishd-wrapper = $${basedirectory:services}/varnishd -varnishlog-wrapper = $${rootdirectory:bin}/varnishlog - -# Binary information -varnishd-binary = ${varnish:location}/sbin/varnishd -varnishlog-binary = ${varnish:location}/bin/varnishlog -shell-path = ${dash:location}/bin/dash -# Configuration by VCL -vcl-file = $${rootdirectory:etc}/default.vcl -pid-file = $${basedirectory:run}/varnishd.pid -varnish-data = $${directory:varnish-data} -# this will pass at -n option -varnish-instance-name = $${directory:varnish-instance} -web-checker = ${buildout:bin-directory}/web_checker_utility - -[cron-entry-web-checker] -<= cron -recipe = slapos.cookbook:cron.d -name = web-checker -frequency = 0 0 * * * -command = $${varnish-instance:web-checker} $${web-checker:web-checker-config} - -[web-checker] -recipe = slapos.cookbook:webchecker -web-checker-config = $${rootdirectory:etc}/web_checker.cfg -web-checker-working-directory = $${directory:web-checker} -# for now frontend-url is varnish, it will replace with the real front-end one. -frontend-url = $${varnish-instance:ip}:$${varnish-instance:server-port} -wget-binary-path = ${wget:location}/bin/wget -varnishlog-binary-path = $${varnish-instance:varnishlog-wrapper} -web-checker-log = $${basedirectory:log}/web-checker.log - -[cron] -recipe = slapos.cookbook:cron -dcrond-binary = ${dcron:location}/sbin/crond -cron-entries = $${directory:cron-entries} -crontabs = $${directory:crontabs} -cronstamps = $${directory:cronstamps} -binary = $${basedirectory:services}/crond -catcher = $${cron-simplelogger:wrapper} - -[cron-simplelogger] -recipe = slapos.cookbook:simplelogger -wrapper = $${rootdirectory:bin}/cron_simplelogger -log = $${basedirectory:log}/cron.log - -[cron-entry-logrotate] -<= cron -recipe = slapos.cookbook:cron.d -name = logrotate -frequency = 0 0 * * * -command = $${logrotate:wrapper} - -[logrotate] -recipe = slapos.cookbook:logrotate -# Binaries -logrotate-binary = ${logrotate:location}/usr/sbin/logrotate -gzip-binary = ${gzip:location}/bin/gzip -gunzip-binary = ${gzip:location}/bin/gunzip -# Directories -wrapper = $${rootdirectory:bin}/logrotate -conf = $${rootdirectory:etc}/logrotate.conf -logrotate-entries = $${directory:logrotate-entries} -backup = $${directory:logrotate-backup} -state-file = $${rootdirectory:srv}/logrotate.status - -[basedirectory] -recipe = slapos.cookbook:mkdirectory -services = $${rootdirectory:etc}/run -run = $${rootdirectory:var}/run -backup = $${rootdirectory:srv}/backup -log = $${rootdirectory:var}/log -backup = $${rootdirectory:srv}/backup - -[directory] -recipe = slapos.cookbook:mkdirectory -varnish-data = $${rootdirectory:srv}/varnish -varnish-instance = $${directory:varnish-data}/instance -cron-entries = $${rootdirectory:etc}/cron.d -crontabs = $${rootdirectory:etc}/crontabs -cronstamps = $${rootdirectory:etc}/cronstamps -logrotate-backup = $${basedirectory:backup}/logrotate -logrotate-entries = $${rootdirectory:etc}/logrotate.d -web-checker = $${rootdirectory:srv}/web-checker - -[rootdirectory] -recipe = slapos.cookbook:mkdirectory -etc = $${buildout:directory}/etc -var = $${buildout:directory}/var -srv = $${buildout:directory}/srv -bin = $${buildout:directory}/bin - diff --git a/software/erp5/instance-varnish.cfg.in b/software/erp5/instance-varnish.cfg.in new file mode 100644 index 0000000000000000000000000000000000000000..f0462dfcb5c68ec83ecb3cc33777a2da1783cf8d --- /dev/null +++ b/software/erp5/instance-varnish.cfg.in @@ -0,0 +1,118 @@ +[buildout] +parts = + publish-varnish-connection-information + varnish-instance + web-checker + cron + cron-entry-logrotate + cron-entry-web-checker + +eggs-directory = {{ eggs_directory }} +develop-eggs-directory = {{ develop_eggs_directory }} +offline = true + +[publish-varnish-connection-information] +recipe = slapos.cookbook:publishurl +url = http://${varnish-instance:ip}:${varnish-instance:server-port}/ + +[varnish-instance] +recipe = slapos.cookbook:generic.varnish + +# Network options +ip = ${slap-network-information:local-ipv4} +server-port = 6001 +manager-port = 6002 + +# Paths: Running wrappers +varnishd-wrapper = ${basedirectory:services}/varnishd +varnishlog-wrapper = ${rootdirectory:bin}/varnishlog + +# Binary information +varnishd-binary = {{ varnish_location }}/sbin/varnishd +varnishlog-binary = {{ varnish_location }}/bin/varnishlog +shell-path = {{ dash_location }}/bin/dash +# Configuration by VCL +vcl-file = ${rootdirectory:etc}/default.vcl +pid-file = ${basedirectory:run}/varnishd.pid +varnish-data = ${directory:varnish-data} +# this will pass at -n option +varnish-instance-name = ${directory:varnish-instance} +web-checker = {{ bin_directory }}/web_checker_utility + +[cron-entry-web-checker] +<= cron +recipe = slapos.cookbook:cron.d +name = web-checker +frequency = 0 0 * * * +command = ${varnish-instance:web-checker} ${web-checker:web-checker-config} + +[web-checker] +recipe = slapos.cookbook:webchecker +web-checker-config = ${rootdirectory:etc}/web_checker.cfg +web-checker-working-directory = ${directory:web-checker} +# for now frontend-url is varnish, it will replace with the real front-end one. +frontend-url = ${varnish-instance:ip}:${varnish-instance:server-port} +wget-binary-path = {{ wget_location }}/bin/wget +varnishlog-binary-path = ${varnish-instance:varnishlog-wrapper} +web-checker-log = ${basedirectory:log}/web-checker.log + +[cron] +recipe = slapos.cookbook:cron +dcrond-binary = {{ dcron_location }}/sbin/crond +cron-entries = ${directory:cron-entries} +crontabs = ${directory:crontabs} +cronstamps = ${directory:cronstamps} +binary = ${basedirectory:services}/crond +catcher = ${cron-simplelogger:wrapper} + +[cron-simplelogger] +recipe = slapos.cookbook:simplelogger +wrapper = ${rootdirectory:bin}/cron_simplelogger +log = ${basedirectory:log}/cron.log + +[cron-entry-logrotate] +<= cron +recipe = slapos.cookbook:cron.d +name = logrotate +frequency = 0 0 * * * +command = ${logrotate:wrapper} + +[logrotate] +recipe = slapos.cookbook:logrotate +# Binaries +logrotate-binary = {{ logrotate_location }}/usr/sbin/logrotate +gzip-binary = {{ gzip_location }}/bin/gzip +gunzip-binary = {{ gzip_location }}/bin/gunzip +# Directories +wrapper = ${rootdirectory:bin}/logrotate +conf = ${rootdirectory:etc}/logrotate.conf +logrotate-entries = ${directory:logrotate-entries} +backup = ${directory:logrotate-backup} +state-file = ${rootdirectory:srv}/logrotate.status + +[basedirectory] +recipe = slapos.cookbook:mkdirectory +services = ${rootdirectory:etc}/run +run = ${rootdirectory:var}/run +backup = ${rootdirectory:srv}/backup +log = ${rootdirectory:var}/log +backup = ${rootdirectory:srv}/backup + +[directory] +recipe = slapos.cookbook:mkdirectory +varnish-data = ${rootdirectory:srv}/varnish +varnish-instance = ${directory:varnish-data}/instance +cron-entries = ${rootdirectory:etc}/cron.d +crontabs = ${rootdirectory:etc}/crontabs +cronstamps = ${rootdirectory:etc}/cronstamps +logrotate-backup = ${basedirectory:backup}/logrotate +logrotate-entries = ${rootdirectory:etc}/logrotate.d +web-checker = ${rootdirectory:srv}/web-checker + +[rootdirectory] +recipe = slapos.cookbook:mkdirectory +etc = ${buildout:directory}/etc +var = ${buildout:directory}/var +srv = ${buildout:directory}/srv +bin = ${buildout:directory}/bin + diff --git a/software/erp5/instance.cfg b/software/erp5/instance.cfg index ffc8fcc5c457f2572f40bbda6dd8fd36a8d83818..6dfd2d274c79552d9b650ce7b8b4c57dd7bbad8a 100644 --- a/software/erp5/instance.cfg +++ b/software/erp5/instance.cfg @@ -33,7 +33,7 @@ zope = ${template-zope:output} mariadb = ${template-mariadb:output} sphinx = ${template-sphinx:output} tidstorage = $${dynamic-template-tidstorage:output} -varnish = ${template-varnish:output} +varnish = ${template-varnish:rendered} [slap-connection] # part to migrate to new - separated words diff --git a/software/erp5/software.cfg b/software/erp5/software.cfg index e69940fb0bc34beb5b7d5521e4bbf65a48447d39..d3f4783fa5d9d9dbf4e36eae9865f98d5b791447 100644 --- a/software/erp5/software.cfg +++ b/software/erp5/software.cfg @@ -156,11 +156,16 @@ output = ${buildout:directory}/template-snippet-backend.cfg mode = 0644 [template-varnish] -recipe = slapos.recipe.template -url = ${:_profile_base_location_}/instance-varnish.cfg -md5sum = 70fb0ccadf0d6723ddb0fe55a1549ca5 -output = ${buildout:directory}/template-varnish.cfg -mode = 0644 +< = template-jinja2-base +filename = instance-varnish.cfg +md5sum = 1e1b1ade6a60d2eb803ac075a753d360 +extra-context = + key dash_location dash:location + key dcron_location dcron:location + key gzip_location gzip:location + key logrotate_location logrotate:location + key varnish_location varnish:location + key wget_location wget:location [networkcache] # signature certificates of the following uploaders.