# This file is responsible of three things:
# 1/ Act as "Apache exporter"
# 2/ Act as "Mariadb backup infrastructure requester"
# 3/ Act as "Apache" instance

{% import 'parts' as parts %}
{% import 'replicated' as replicated %}

[buildout]
extends = {{templateapache}}
          {{templatepbsreadyexport}}

parts +=
    certificate-authority
    logrotate
    cron
    publish-connection-informations
    cron-entry-backup


# Repeating parts from instance-apache-php.
# XXX-Cedric: how to simplify this?
#    logrotate-entry-apache
#    cron-entry-logrotate
#    promise
#    frontend-promise
#    content-promise


# Nothing to do for the exporter. This wrapper is intended
# to produce the "dump" files that have to be backed up.
# So, in case of binary DB data, we would back up the ASCII dump
# files, or a similar data format that can be restored on any machine
# (i.e. postgres 'custom')
# In the case of an httpd instance, the src/www directory can be directly
# pulled from the PBS, we don't need to prepare anything.
[exporter]
wrapper = /bin/true

# 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]
path = ${directory:www}

# Add "exporter" parameters to list of published connection parameters
[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