Commit da310364 authored by Viktor Horvath's avatar Viktor Horvath

After first help from Marco

parent ade01a05
[buildout] [buildout]
parts = parts =
postgres-urlparse
apacheperl-promise apacheperl-promise
publish-connection-information publish-connection-information
# mioga-instance
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
...@@ -43,4 +45,26 @@ port = $${apacheperl-instance:port} ...@@ -43,4 +45,26 @@ port = $${apacheperl-instance:port}
[publish-connection-information] [publish-connection-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
apacheperl_url = http://[$${apacheperl-instance:ip}]:$${apacheperl-instance:port} apacheperl_url = http://[$${apacheperl-instance:ip}]:$${apacheperl-instance:port}
\ No newline at end of file
# Request Postgres instance and parse its URL
[request-postgres]
<= slap-connection
recipe = slapos.cookbook:request
name = Postgres
software-url = $${slap-connection:software-release-url}
software-type = postgres
return = url
sla = computer_guid
sla-computer_guid = $${slap-connection:computer-id}
[postgres-urlparse]
recipe = slapos.cookbook:urlparse
url = $${request-postgres:connection-url}
[symlinks]
recipe = cns.recipe.symlink
symlink_target = $${rootdirectory:bin}
symlink_base = ${postgresql:location}/bin
# [mioga-instance]
\ No newline at end of file
[buildout]
parts =
symlinks
publish
postgres-instance
postgres-promise
# 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
[instance-parameters]
# Fetches parameters defined in SlapOS Master for this instance
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}
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
bin = $${buildout:directory}/bin
etc = $${buildout:directory}/etc
services = $${rootdirectory:etc}/run/
promises = $${rootdirectory:etc}/promise/
var = $${buildout:directory}/var
[symlinks]
recipe = cns.recipe.symlink
symlink_target = $${rootdirectory:bin}
symlink_base = ${postgresql:location}/bin
[postgres-instance]
# create cluster, configuration files and a database
recipe = slapos.cookbook:postgres
# Options
ipv6_host = $${slap-network-information:global-ipv6}
user = postgres
port = 5432
dbname = db
# pgdata_directory is created by initdb, and should not exist beforehand.
pgdata-directory = $${rootdirectory:var}/data
services = $${rootdirectory:services}
bin = $${rootdirectory:bin}
# Deploy promises scripts
[postgres-promise]
recipe = slapos.cookbook:check_port_listening
path = $${rootdirectory:promises}/postgres
hostname = $${slap-network-information:global-ipv6}
port = $${postgres-instance:port}
[publish]
recipe = slapos.cookbook:publishurl
url = $${postgres-instance:url}
...@@ -9,12 +9,13 @@ offline = true ...@@ -9,12 +9,13 @@ offline = true
[switch-softwaretype] [switch-softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:softwaretype
default = ${template-apacheperl:output} default = ${template-apacheperl:output}
postgres = ${template-postgres:output}
[slap-connection] # [slap-connection]
# part to migrate to new - separated words # # part to migrate to new - separated words
computer-id = $${slap_connection:computer_id} # computer-id = $${slap_connection:computer_id}
partition-id = $${slap_connection:partition_id} # partition-id = $${slap_connection:partition_id}
server-url = $${slap_connection:server_url} # server-url = $${slap_connection:server_url}
software-release-url = $${slap_connection:software_release_url} # software-release-url = $${slap_connection:software_release_url}
key-file = $${slap_connection:key_file} # key-file = $${slap_connection:key_file}
cert-file = $${slap_connection:cert_file} # cert-file = $${slap_connection:cert_file}
\ No newline at end of file \ No newline at end of file
...@@ -22,7 +22,6 @@ extends = ...@@ -22,7 +22,6 @@ extends =
parts = parts =
eggs eggs
apache-perl apache-perl
template
perl-Apache2-Request perl-Apache2-Request
perl-Crypt-SSLeay perl-Crypt-SSLeay
perl-DBD-Pg perl-DBD-Pg
...@@ -36,26 +35,16 @@ parts = ...@@ -36,26 +35,16 @@ parts =
perl-Search-Xapian perl-Search-Xapian
cpan-simple-modules cpan-simple-modules
mioga mioga
template
template-apacheperl
template-postgres
[eggs] [eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
slapos.cookbook slapos.cookbook
cns.recipe.symlink
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
# md5sum =
output = ${buildout:directory}/template.cfg
mode = 0644
[template-apacheperl]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apacheperl.cfg
# md5sum =
output = ${buildout:directory}/template-apacheperl.cfg
mode = 0644
[cpan-simple-modules] [cpan-simple-modules]
recipe = slapos.recipe.build:cpan recipe = slapos.recipe.build:cpan
...@@ -126,6 +115,27 @@ url = ${:_profile_base_location_}/${:filename} ...@@ -126,6 +115,27 @@ url = ${:_profile_base_location_}/${:filename}
download-only = true download-only = true
filename = mioga-hooks.py filename = mioga-hooks.py
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
# md5sum =
output = ${buildout:directory}/template.cfg
mode = 0644
[template-apacheperl]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apacheperl.cfg
# md5sum =
output = ${buildout:directory}/template-apacheperl.cfg
mode = 0644
[template-postgres]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-postgres.cfg
# md5sum =
output = ${buildout:directory}/template-postgres.cfg
mode = 0644
[networkcache] [networkcache]
# Cedric de Saint Martin signature certificate # Cedric de Saint Martin signature certificate
signature-certificate-list = signature-certificate-list =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment