Merge branch 'erp5-component' into erp5
[slapos.git] / stack / erp5 / instance-varnish.cfg.in
1 {% if software_type == slap_software_type -%}
2 {% set web_checker_parameter = slapparameter_dict['web-checker-mail-address'] -%}
3 [buildout]
4 parts =
5   publish-varnish-connection-information
6   varnish-instance
7   cron
8   cron-entry-logrotate
9   {# When web_checker related parameter is given, web_checker will be enabled.#}
10 {% if web_checker_parameter is defined %}
11   web-checker
12   cron-entry-web-checker
13 {% endif %}
14
15 eggs-directory = {{ eggs_directory }}
16 develop-eggs-directory = {{ develop_eggs_directory }}
17 offline = true
18
19 [publish-varnish-connection-information]
20 recipe = slapos.cookbook:publishurl
21 url = http://${varnish-instance:ip}:${varnish-instance:server-port}/
22
23 [varnish-instance]
24 recipe = slapos.cookbook:generic.varnish
25
26 # Network options
27 ip = ${slap-network-information:local-ipv4}
28 server-port = 6001
29 manager-port = 6002
30
31 # Paths: Running wrappers
32 varnishd-wrapper = ${basedirectory:services}/varnishd
33 varnishlog-wrapper = ${rootdirectory:bin}/varnishlog
34
35 # Binary information
36 varnishd-binary = {{ parameter_dict['varnish'] }}/sbin/varnishd
37 varnishlog-binary = {{ parameter_dict['varnish'] }}/bin/varnishlog
38 shell-path = {{ parameter_dict['dash'] }}/bin/dash
39 # Configuration by VCL
40 vcl-file = ${rootdirectory:etc}/default.vcl
41 pid-file = ${basedirectory:run}/varnishd.pid
42 varnish-data = ${directory:varnish-data}
43 # this will pass at -n option
44 varnish-instance-name = ${directory:varnish-instance}
45 web-checker = {{ parameter_dict['buildout-bin-directory'] }}/web_checker_utility
46
47 [cron-entry-web-checker]
48 <= cron
49 recipe = slapos.cookbook:cron.d
50 name = web-checker
51 frequency = 0 0 * * *
52 command = ${varnish-instance:web-checker} ${web-checker:web-checker-config}
53
54 [web-checker]
55 recipe = slapos.cookbook:webchecker
56 web-checker-config = ${rootdirectory:etc}/web_checker.cfg
57 web-checker-working-directory = ${directory:web-checker}
58 frontend-url = ${varnish-instance:ip}:${varnish-instance:server-port}
59 wget-binary-path = {{ parameter_dict['wget'] }}/bin/wget
60 varnishlog-binary-path = ${varnish-instance:varnishlog-wrapper}
61 web-checker-log = ${basedirectory:log}/web-checker.log
62
63 [cron]
64 recipe = slapos.cookbook:cron
65 dcrond-binary = {{ parameter_dict['dcron'] }}/sbin/crond
66 cron-entries = ${directory:cron-entries}
67 crontabs = ${directory:crontabs}
68 cronstamps = ${directory:cronstamps}
69 binary = ${basedirectory:services}/crond
70 catcher = ${cron-simplelogger:wrapper}
71
72 [cron-simplelogger]
73 recipe = slapos.cookbook:simplelogger
74 wrapper = ${rootdirectory:bin}/cron_simplelogger
75 log = ${basedirectory:log}/cron.log
76
77 [cron-entry-logrotate]
78 <= cron
79 recipe = slapos.cookbook:cron.d
80 name = logrotate
81 frequency = 0 0 * * *
82 command = ${logrotate:wrapper}
83
84 [logrotate]
85 recipe = slapos.cookbook:logrotate
86 # Binaries
87 logrotate-binary = {{ parameter_dict['logrotate'] }}/usr/sbin/logrotate
88 gzip-binary = {{ parameter_dict['gzip'] }}/bin/gzip
89 gunzip-binary = {{ parameter_dict['gzip'] }}/bin/gunzip
90 # Directories
91 wrapper = ${rootdirectory:bin}/logrotate
92 conf = ${rootdirectory:etc}/logrotate.conf
93 logrotate-entries = ${directory:logrotate-entries}
94 backup = ${directory:logrotate-backup}
95 state-file = ${rootdirectory:srv}/logrotate.status
96
97 [basedirectory]
98 recipe = slapos.cookbook:mkdirectory
99 services = ${rootdirectory:etc}/run
100 run = ${rootdirectory:var}/run
101 backup = ${rootdirectory:srv}/backup
102 log = ${rootdirectory:var}/log
103 backup = ${rootdirectory:srv}/backup
104
105 [directory]
106 recipe = slapos.cookbook:mkdirectory
107 varnish-data = ${rootdirectory:srv}/varnish
108 varnish-instance = ${directory:varnish-data}/instance
109 cron-entries = ${rootdirectory:etc}/cron.d
110 crontabs = ${rootdirectory:etc}/crontabs
111 cronstamps = ${rootdirectory:etc}/cronstamps
112 logrotate-backup = ${basedirectory:backup}/logrotate
113 logrotate-entries = ${rootdirectory:etc}/logrotate.d
114 web-checker = ${rootdirectory:srv}/web-checker
115
116 [rootdirectory]
117 recipe = slapos.cookbook:mkdirectory
118 etc = ${buildout:directory}/etc
119 var = ${buildout:directory}/var
120 srv = ${buildout:directory}/srv
121 bin = ${buildout:directory}/bin
122 {% endif %}