kvm: converted templates to jinja2
[slapos.git] / software / postgres / instance.cfg.in
1 [buildout]
2 parts =
3   publish
4   postgres-instance
5   postgres-promise
6
7
8 # Define egg directories to be the one from Software Release
9 # (/opt/slapgrid/...)
10 eggs-directory = ${buildout:eggs-directory}
11 develop-eggs-directory = ${buildout:develop-eggs-directory}
12 offline = true
13
14
15 [directories]
16 recipe = slapos.cookbook:mkdirectory
17 bin = $${buildout:directory}/bin
18 etc = $${buildout:directory}/etc
19 srv = $${buildout:directory}/srv
20 services = $${directories:etc}/service
21 promises = $${directories:etc}/promise
22 var = $${buildout:directory}/var
23
24
25 #----------------
26 #--
27 #-- Creates a Postgres cluster, configuration files, and a database.
28
29 [postgres-instance]
30 recipe = slapos.cookbook:postgres
31
32 # Options
33 ipv6 = $${instance-parameters:ipv6}
34 # listen to connections from anywhere
35 ipv6-netmask-bits = 0
36 ipv4 = $${instance-parameters:ipv4}
37 # listen to connections from anywhere
38 ipv4-netmask-bits = 0
39 ipv6-random = $${instance-parameters:ipv6-random}
40 superuser = postgres
41 password = $${gen-passwd:passwd}
42 port = 5432
43 dbname = db
44 # pgdata_directory is created by initdb, and should not exist beforehand.
45 pgdata-directory = $${directories:var}/data
46 bin = ${postgresql:location}/bin
47 services = $${directories:services}
48
49
50 #----------------
51 #--
52 #-- Generates a random password and stores it in the filesystem
53
54 [gen-passwd]
55 recipe = slapos.cookbook:generate.password
56 storage-path = $${directories:srv}/postgres_passwd
57 bytes = 16
58
59
60 #----------------
61 #--
62 #-- Deploy promise scripts.
63
64 [postgres-promise]
65 recipe = slapos.cookbook:check_port_listening
66 path = $${directories:promises}/postgres
67 hostname = $${instance-parameters:ipv6-random}
68 port = $${postgres-instance:port}
69
70
71 #----------------
72 #--
73 #-- Publish instance parameters.
74
75 [publish]
76 recipe = slapos.cookbook:publish
77 url = $${postgres-instance:url}
78
79
80 #----------------
81 #--
82 #-- Fetches parameters defined in SlapOS Master for this instance
83
84 [instance-parameters]
85 recipe = slapos.cookbook:slapconfiguration
86 computer = $${slap-connection:computer-id}
87 partition = $${slap-connection:partition-id}
88 url = $${slap-connection:server-url}
89 key = $${slap-connection:key-file}
90 cert = $${slap-connection:cert-file}
91