instance-varnish.cfg.in 4.36 KB
Newer Older
1
{% if software_type == slap_software_type -%}
2
{% set web_checker_parameter = slapparameter_dict['web-checker-mail-address'] -%}
3 4 5 6 7 8
[buildout]
parts =
  publish-varnish-connection-information
  varnish-instance
  cron
  cron-entry-logrotate
9 10 11
  {# When web_checker related parameter is given, web_checker will be enabled.#}
{% if web_checker_parameter is defined %}
  web-checker
12
  cron-entry-web-checker
13
  logrotate-entry-web-checker
14
{% endif %}
15 16 17 18 19 20

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

[publish-varnish-connection-information]
21
recipe = slapos.cookbook:publishurl
22 23 24 25 26 27 28 29 30
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
31
stunnel-port = 6003
32 33 34 35

# Paths: Running wrappers
varnishd-wrapper = ${basedirectory:services}/varnishd
varnishlog-wrapper = ${rootdirectory:bin}/varnishlog
36
stunnel-wrapper = ${basedirectory:services}/stunnel
37 38

# Binary information
39 40 41
varnishd-binary = {{ parameter_dict['varnish'] }}/sbin/varnishd
varnishlog-binary = {{ parameter_dict['varnish'] }}/bin/varnishlog
shell-path = {{ parameter_dict['dash'] }}/bin/dash
42
stunnel-binary = {{ parameter_dict['stunnel'] }}/bin/stunnel
43 44 45
# Configuration by VCL
vcl-file = ${rootdirectory:etc}/default.vcl
pid-file = ${basedirectory:run}/varnishd.pid
46 47
stunnel-conf-file = ${rootdirectory:etc}/stunnel.conf
stunnel-pid-file = ${basedirectory:run}/stunnel.pid
48 49 50
varnish-data = ${directory:varnish-data}
# this will pass at -n option
varnish-instance-name = ${directory:varnish-instance}
51
web-checker = {{ parameter_dict['buildout-bin-directory'] }}/web_checker_utility
52 53 54 55 56 57 58 59 60 61 62 63 64

[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}
frontend-url = ${varnish-instance:ip}:${varnish-instance:server-port}
65
wget-binary-path = {{ parameter_dict['wget'] }}/bin/wget
66 67 68 69 70
varnishlog-binary-path = ${varnish-instance:varnishlog-wrapper}
web-checker-log = ${basedirectory:log}/web-checker.log

[cron]
recipe = slapos.cookbook:cron
71
dcrond-binary = {{ parameter_dict['dcron'] }}/sbin/crond
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
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
93 94 95
logrotate-binary = {{ parameter_dict['logrotate'] }}/usr/sbin/logrotate
gzip-binary = {{ parameter_dict['gzip'] }}/bin/gzip
gunzip-binary = {{ parameter_dict['gzip'] }}/bin/gunzip
96 97 98 99 100 101 102
# 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

103 104 105 106 107 108 109 110 111 112 113
[logrotate-entry-web-checker]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = web-checker
log = ${web-checker:web-checker-log}
frequency = daily
rotate-num = 30
sharedscripts = true
notifempty = true
create = true

114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
[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
139
{% endif %}