Cleanup and use of latest resilient improvements in lamp stack.

parent b422a031
# This file is responsible of two things: # This file is responsible of three things:
# 1/ Act as "Apache exporter" # 1/ Act as "Apache exporter"
# 2/ Act as "Mariadb backup infrastructure requester" # 2/ Act as "Mariadb backup infrastructure requester"
# 3/ Act as "Apache" instance
{% import 'parts' as parts %} {% import 'parts' as parts %}
{% import 'replicated' as replicated %} {% import 'replicated' as replicated %}
...@@ -9,7 +10,6 @@ ...@@ -9,7 +10,6 @@
extends = {{templateapache}} extends = {{templateapache}}
{{templatepbsreadyexport}} {{templatepbsreadyexport}}
parts += parts +=
{{ parts.replicate("mariadb", "3") }} {{ parts.replicate("mariadb", "3") }}
...@@ -34,17 +34,24 @@ parts += ...@@ -34,17 +34,24 @@ parts +=
# Nothing to do for the exporter. Just dummy part that does nothing. # Nothing to do for the exporter. Just dummy part that does nothing.
# For httpd instance, PBS will directly pull data from srv/www. # For httpd instance, PBS will directly pull data from srv/www.
# XXX-Cedric: write a real backup system.
[exporter] [exporter]
wrapper = /bin/true wrapper = /bin/true
# State that we want to backup srv/www directory, not srv/backup. # State that we want to backup srv/www directory, not srv/backup.
# XXX-Cedric: works well, but doesn't work with big data.
[rdiff-backup-server] [rdiff-backup-server]
path = ${directory:www} path = ${directory:www}
# XXX-Cedric: resilient uses "urls" part to publish, but apache doesn't. # Add "exporter" parameters to list of published connection parameters
[urls] [publish-connection-informations]
<= publish-connection-informations # XXX-Cedric: Long term goal: could be a recipe that requests an instance and
# bubbles ALL
# parameters of the requested instance. Requirement: aggregated publish.
<= resilient-publish-connection-parameter
# XXX-Cedric: resilient overwrites what's returned from request-mariadb # XXX-Cedric: resilient overwrites what's returned from request-mariadb
# XXX-Cedric: change the request method to return everything from
# getConnectionParameterDict()
[request-mariadb] [request-mariadb]
return = ssh-public-key ssh-url notification-id ip url return = ssh-public-key ssh-url notification-id ip url
...@@ -3,30 +3,18 @@ eggs-directory = ${buildout:eggs-directory} ...@@ -3,30 +3,18 @@ eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true offline = true
# XXX-Cedric: is instance-apache-php needed?
#extends = ${instance-apache-php:output}
# ${pbsready-import:output}
extends = ${pbsready-import:output} extends = ${pbsready-import:output}
parts +=
# have to repeat the next one, as it's not inherited from pbsready-import
import-on-notification
[directory] [directory]
srv = $${buildout:directory}/srv srv = $${buildout:directory}/srv
www = $${:srv}/www/ www = $${:srv}/www/
# Nothing to do for the import. Just dummy part that does nothing. # Nothing to do for the import. Just dummy part that does nothing.
# For httpd instance, PBS will directly push data to srv/www. # For httpd instance, PBS will directly push data to srv/www.
# XXX-Cedric: is it safe? # XXX-Cedric: write a real backup system.
[importer] [importer]
wrapper = /bin/true wrapper = /bin/true
# XXX-Cedric: resilient uses "urls" part to publish, but apache doesn't.
[urls]
recipe = slapos.cookbook:publish
# State that we want to push to srv/www directory, not srv/backup. # State that we want to push to srv/www directory, not srv/backup.
[rdiff-backup-server] [rdiff-backup-server]
path = $${directory:www} path = $${directory:www}
...@@ -81,7 +81,7 @@ mode = 0644 ...@@ -81,7 +81,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/apache/instance-apache-import.cfg.in url = ${:_profile_base_location_}/apache/instance-apache-import.cfg.in
output = ${buildout:directory}/instance-apache-import.cfg output = ${buildout:directory}/instance-apache-import.cfg
md5sum = 4067a0d32efbfad3923f3fe5a8ce77b4 md5sum = f1dc2a71d362b5d2d36481ffefdd2293
mode = 0644 mode = 0644
[instance-apache-export] [instance-apache-export]
...@@ -95,7 +95,7 @@ context = key templateapache instance-apache-php:output ...@@ -95,7 +95,7 @@ context = key templateapache instance-apache-php:output
import-list = file parts template-parts:destination import-list = file parts template-parts:destination
file replicated template-replicated:destination file replicated template-replicated:destination
md5sum = 6647004fd5a2a3d74e3d7f8aa6b4b226 md5sum = 2dc6134621b8a12817d43a979b84089a
mode = 0644 mode = 0644
[instance-resilient] [instance-resilient]
...@@ -131,7 +131,7 @@ mode = 0644 ...@@ -131,7 +131,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/mariadb/instance-mariadb-export.cfg.in url = ${:_profile_base_location_}/mariadb/instance-mariadb-export.cfg.in
output = ${buildout:directory}/instance-mariadb-export.cfg output = ${buildout:directory}/instance-mariadb-export.cfg
md5sum = 13703a15d9d73f59598505dac8ed4967 md5sum = 0352896921ca1766b64f0b54f0f8c27e
mode = 0644 mode = 0644
......
...@@ -18,6 +18,7 @@ parts += ...@@ -18,6 +18,7 @@ parts +=
slapmonitor slapmonitor
slapmonitor-xml slapmonitor-xml
# Define exporter strategy
[exporter] [exporter]
recipe = slapos.cookbook:mydumper recipe = slapos.cookbook:mydumper
wrapper = $${rootdirectory:bin}/$${slap-parameter:namebase}-exporter wrapper = $${rootdirectory:bin}/$${slap-parameter:namebase}-exporter
...@@ -27,3 +28,7 @@ user = root ...@@ -27,3 +28,7 @@ user = root
mydumper-binary = ${mydumper:location}/bin/mydumper mydumper-binary = ${mydumper:location}/bin/mydumper
database = $${mariadb:database} database = $${mariadb:database}
import = false import = false
# Extends publish section with resilient parameters
[urls]
<= resilient-publish-connection-parameter
\ No newline at end of file
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