kvm frontend listen to ipv6 and ipv4
[slapos.git] / software / kvm / instance-frontend.cfg.in
1 #############################
2 #
3 # Instanciate kvm frontend
4 #
5 #############################
6 [buildout]
7 parts =
8   logrotate
9 #   logrotate-entry-frontend
10   cron
11   cron-entry-logrotate
12   ca-frontend
13   certificate-authority
14   frontend-promise-ipv6
15   frontend-promise-ipv4
16
17 eggs-directory = ${buildout:eggs-directory}
18 develop-eggs-directory = ${buildout:develop-eggs-directory}
19 offline = true
20
21 [rootdirectory]
22 recipe = slapos.cookbook:mkdirectory
23 etc = $${buildout:directory}/etc
24 bin = $${buildout:directory}/bin
25 srv = $${buildout:directory}/srv
26 var = $${buildout:directory}/var
27
28 [basedirectory]
29 recipe = slapos.cookbook:mkdirectory
30 services = $${rootdirectory:etc}/run
31 promises = $${rootdirectory:etc}/promise
32 nodejs-conf = $${rootdirectory:etc}/nodejs
33 run = $${rootdirectory:var}/run
34 log = $${rootdirectory:var}/log
35 ca-dir = $${rootdirectory:srv}/ssl
36 backup = $${rootdirectory:srv}/backup
37
38 [directory]
39 recipe = slapos.cookbook:mkdirectory
40 cron-entries = $${rootdirectory:etc}/cron.d
41 crontabs = $${rootdirectory:etc}/crontabs
42 cronstamps = $${rootdirectory:etc}/cronstamps
43 ca-dir = $${rootdirectory:srv}/ssl
44 logrotate-backup = $${basedirectory:backup}/logrotate
45 logrotate-entries = $${rootdirectory:etc}/logrotate.d
46
47 [frontend-instance]
48 recipe = slapos.cookbook:kvm.frontend
49 domain = $${ca-frontend:name}
50 # port = $${slap-parameter:port}
51 ipv6 = $${slap-network-information:global-ipv6}
52 ipv4 = $${slap-network-information:local-ipv4}
53 port = $${slap-parameter:port}
54 http-redirection = $${slap-parameter:http-redirection}
55 ssl-key-path = $${ca-frontend:key-file}
56 ssl-cert-path = $${ca-frontend:cert-file}
57 slave-instance-list = $${slap-parameter:slave_instance_list}
58 map-path = $${basedirectory:nodejs-conf}/proxy_table.json
59 conf-path = $${basedirectory:nodejs-conf}/kvm-proxy.js
60 wrapper-path = $${rootdirectory:bin}/kvm_frontend
61 node-binary = ${nodejs:location}/bin/node
62 node-env = ${buildout:parts-directory}:${npm-modules:location}/node_modules
63 shell-path = ${dash:location}/bin/dash
64
65 [frontend-promise-ipv6]
66 recipe = slapos.cookbook:check_port_listening
67 path = $${basedirectory:promises}/frontend_promise
68 hostname = $${frontend-instance:ipv6}
69 port = $${frontend-instance:port}
70
71 [frontend-promise-ipv4]
72 recipe = slapos.cookbook:check_port_listening
73 path = $${basedirectory:promises}/frontend_promise
74 hostname = $${frontend-instance:ipv4}
75 port = $${frontend-instance:port}
76
77 [certificate-authority]
78 recipe = slapos.cookbook:certificate_authority
79 openssl-binary = ${openssl:location}/bin/openssl
80 ca-dir = $${basedirectory:ca-dir}
81 requests-directory = $${cadirectory:requests}
82 wrapper = $${basedirectory:services}/certificate_authority
83 ca-private = $${cadirectory:private}
84 ca-certs = $${cadirectory:certs}
85 ca-newcerts = $${cadirectory:newcerts}
86 ca-crl = $${cadirectory:crl}
87
88 [cadirectory]
89 recipe = slapos.cookbook:mkdirectory
90 requests = $${basedirectory:ca-dir}/requests/
91 private = $${basedirectory:ca-dir}/private/
92 certs = $${basedirectory:ca-dir}/certs/
93 newcerts = $${basedirectory:ca-dir}/newcerts/
94 crl = $${basedirectory:ca-dir}/crl/
95
96 [ca-frontend]
97 <= certificate-authority
98 recipe = slapos.cookbook:certificate_authority.request
99 key-file = $${basedirectory:nodejs-conf}/nodejs.key
100 cert-file = $${basedirectory:nodejs-conf}/nodejs.crt
101 executable = $${frontend-instance:wrapper-path}
102 wrapper = $${basedirectory:services}/nodejs
103 # Put domain name
104 name = $${slap-parameter:domain}
105
106 [cron]
107 recipe = slapos.cookbook:cron
108 dcrond-binary = ${dcron:location}/sbin/crond
109 cron-entries = $${directory:cron-entries}
110 crontabs = $${directory:crontabs}
111 cronstamps = $${directory:cronstamps}
112 catcher = $${cron-simplelogger:wrapper}
113 binary = $${basedirectory:services}/crond
114
115 [cron-simplelogger]
116 recipe = slapos.cookbook:simplelogger
117 wrapper = $${rootdirectory:bin}/cron_simplelogger
118 log = $${basedirectory:log}/cron.log
119
120 [cron-entry-logrotate]
121 <= cron
122 recipe = slapos.cookbook:cron.d
123 name = logrotate
124 frequency = 0 0 * * *
125 command = $${logrotate:wrapper}
126
127 [logrotate]
128 recipe = slapos.cookbook:logrotate
129 # Binaries
130 logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
131 gzip-binary = ${gzip:location}/bin/gzip
132 gunzip-binary = ${gzip:location}/bin/gunzip
133 # Directories
134 wrapper = $${rootdirectory:bin}/logrotate
135 conf = $${rootdirectory:etc}/logrotate.conf
136 logrotate-entries = $${directory:logrotate-entries}
137 backup = $${directory:logrotate-backup}
138 state-file = $${rootdirectory:srv}/logrotate.status
139
140 [slap-parameter]
141 # Default value if no port is specified
142 port = 4443
143 http-redirection = 0
144 slave_instance_list =
145
146 # [logrotate-entry-frontend]
147 # <= logrotate
148 # recipe = slapos.cookbook:logrotate.d
149 # name = frontend
150 # log = $${mariadb-instance:error-log} $${mariadb-instance:slow-query-log}
151 # post = $${mariadb-instance:mysql-binary} --no-defaults -B --socket=$${mariadb-instance:socket} -e "FLUSH LOGS"