instance.cfg.in 2.08 KB
Newer Older
1 2 3 4
[buildout]
parts =
  publish
  postgres-instance
5
  postgres-promise
6 7 8 9 10 11 12 13 14 15 16 17 18


# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true


[directories]
recipe = slapos.cookbook:mkdirectory
bin = $${buildout:directory}/bin
etc = $${buildout:directory}/etc
19
srv = $${buildout:directory}/srv
20 21
services = $${directories:etc}/service
promises = $${directories:etc}/promise
22 23 24
var = $${buildout:directory}/var


25 26 27 28
#----------------
#--
#-- Creates a Postgres cluster, configuration files, and a database.

29 30 31 32
[postgres-instance]
recipe = slapos.cookbook:postgres

# Options
33
ipv6 = $${instance-parameters:ipv6}
34 35
# listen to connections from anywhere
ipv6_netmask_bits = 0
36
ipv4 = $${instance-parameters:ipv4}
37 38
# listen to connections from anywhere
ipv4_netmask_bits = 0
39
ipv6_random = $${instance-parameters:ipv6_random}
40
superuser = postgres
41
password = $${gen-passwd:passwd}
42 43 44 45
port = 5432
dbname = db
# pgdata_directory is created by initdb, and should not exist beforehand.
pgdata-directory = $${directories:var}/data
Marco Mariani's avatar
Marco Mariani committed
46
bin = ${postgresql:location}/bin
47
services = $${directories:services}
48 49


50 51 52 53 54 55 56 57 58 59
#----------------
#--
#-- Generates a random password and stores it in the filesystem

[gen-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${directories:srv}/postgres_passwd
bytes = 16


60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
#----------------
#--
#-- Deploy promise scripts.

[postgres-promise]
recipe = slapos.cookbook:check_port_listening
path = $${directories:promises}/postgres
hostname = $${instance-parameters:ipv6_random}
port = $${postgres-instance:port}


#----------------
#--
#-- Publish instance parameters.

75
[publish]
76
recipe = slapos.cookbook:publish
77 78 79
url = $${postgres-instance:url}


80 81 82 83 84 85 86 87 88 89 90
#----------------
#--
#-- Fetches parameters defined in SlapOS Master for this instance

[instance-parameters]
recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
91