Commit d48ecc9c authored by Tom Niget's avatar Tom Niget

postgresql

parent c9ee9f37
......@@ -15,11 +15,11 @@
[template]
filename = instance.cfg.in
md5sum = ec2cac2499cb1748402da9cb73e81a1e
md5sum = 3b22160ee34e004983fd17c503391ade
[template-default]
_update_hash_filename_ = instance-default.cfg.in
md5sum = 10ff0aaefca7ad7f2746fbfa0b3abc0e
md5sum = c71a9dca86ef4e2115ecaed12fb9b3e3
[dovecot.jinja2.conf]
_update_hash_filename_ = dovecot.jinja2.conf
......@@ -47,7 +47,7 @@ md5sum = e49410f0a4bf28993a56bb28aff0a6f0
[template-php.ini]
filename = php.ini.in
md5sum = 677e1185a99d337cd1be778c548a6d30
md5sum = eccdfb6d780d9aa4cf66401191ab16a6
[template-apache-httpd]
filename = apache-httpd.conf.in
......
......@@ -50,6 +50,7 @@ tmp-php = ${:tmp}/php
upload-tmp = ${:tmp}/upload
www = ${:srv}/www/
apache.d = ${:etc}/apache.d
srv-backup = ${:srv}/backup
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
......@@ -201,14 +202,14 @@ hash-files =
${postfix-conf-main:output}
${postfix-wrapper:output}
[apache-php-service]
recipe = slapos.cookbook:wrapper
command-line = ${ca-apache-php:wrapper}
wrapper-path = ${directory:service}/apache-php
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
depends =
${copy-application:recipe}
${apache-graceful:recipe}
#[apache-php-service]
#recipe = slapos.cookbook:wrapper
#command-line = ${ca-apache-php:wrapper}
#wrapper-path = ${directory:service}/apache-php
#hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
#depends =
# ${copy-application:recipe}
# ${apache-graceful:recipe}
[apache-graceful]
recipe = collective.recipe.template
......@@ -243,6 +244,13 @@ cert-file = ${ca-directory:certs}/httpd.crt
key-file = ${ca-directory:certs}/httpd.key
apache-config-dir = ${directory:apache.d}
[postgresql-backup-crontab-entry]
recipe = slapos.cookbook:cron.d
name = ${:_buildout_section_name_}
cron-entries = ${cron:cron-entries}
time = daily
command = ${postgresql-backup:wrapper-path}
[publish-connection-information]
<= monitor-publish
recipe = slapos.cookbook:publish
......@@ -251,10 +259,28 @@ smtp-port = 10025
imap-smtp-ipv6 = ${slap-configuration:ipv6-random}
domain = ${request-dns-entry:connection-domain}
backend-url = ${apache-php-configuration:url}
backup-crontab = ${postgresql-backup-crontab-entry:name}
{% if apache_parameter_dict['publish-frontend'] -%}
#url = ${lamp-frontend-promise:url}
{% endif -%}
[postgresql-backup]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/${:_buildout_section_name_}
# XXX there's a recipe for backup in slapos cookbook, but it does not create
# the backup file in an atomic way, which is not acceptable here, because we
# don't want to risk pulling a partial file. To prevent this, we create a
# temp file and move it when finished.
command-line =
sh -c "${postgresql:bin}/pg_dump \
-h ${postgresql:pgdata-directory} \
-U ${postgresql:superuser} \
--format=custom \
-f ${:backup-file}.tmp \
${postgresql:dbname} \
&& mv ${:backup-file}.tmp ${:backup-file}"
backup-file = ${directory:srv-backup}/backup.pg_dump
[request-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
......@@ -388,7 +414,7 @@ parts =
imap-listen-promise
smtp-listen-promise
php.ini-conf
apache-php-service
# apache-php-service
{{ part_list | join('\n ') }}
{% if slapparameter_dict.get('request_dns', '') %}
request-dns-entry
......@@ -399,17 +425,52 @@ develop-eggs-directory = {{ develop_eggs_directory }}
offline= true
[mariadb-urlparse]
recipe = slapos.cookbook:urlparse
url = {{ slapparameter_dict['database-list'][0] }}
[postgresql-password]
recipe = slapos.cookbook:generate.password
[postgresql]
recipe = slapos.cookbook:postgres
bin = {{ postgresql_location }}/bin
services = ${directory:service}
dbname = dependency-track_db
superuser = dependency-track-psql
password = ${postgresql-password:passwd}
pgdata-directory = ${directory:srv}/postgresql
ipv4 =
# disable listening on ipv6
ipv6 = ${slap-configuration:ipv6-random}
port = 5432
promises = $${postgresql-promise:name}
[postgresql-psql]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:bin}/$${:_buildout_section_name_}
command-line =
$${postgresql:bin}/psql
-h $${postgresql:pgdata-directory}
-U $${postgresql:superuser}
-d $${postgresql:dbname}
[postgresql-promise]
<= monitor-promise-base
promise = check_command_execute
name = promise-postgresql.py
config-command = $${postgresql-psql:wrapper-path} -c '\q'
#[mariadb-urlparse]
#recipe = slapos.cookbook:urlparse
#url = slapparameter_dict['database-list'][0]
[instance-parameter]
# snappymail = ${:document-root}
db-user = ${mariadb-urlparse:username}
db-password = ${mariadb-urlparse:password}
db-name = ${mariadb-urlparse:path}
db-host = ${mariadb-urlparse:host}
db-port = ${mariadb-urlparse:port}
#db-user = ${mariadb-urlparse:username}
#db-password = ${mariadb-urlparse:password}
#db-name = ${mariadb-urlparse:path}
#db-host = ${mariadb-urlparse:host}
#db-port = ${mariadb-urlparse:port}
document-root = ${apache-php-configuration:document-root}
backend-url = ${apache-php-configuration:url}
php-bin = {{ apache_parameter_dict['apache-php-location'] }}/bin/php
......
......@@ -46,6 +46,7 @@ extra-context =
key ipv4_set slap-configuration:ipv4
key ipv6_set slap-configuration:ipv6
raw bin_directory {{ bin_directory }}
raw postgresql_location {{ postgresql_location }}
section mariadb_parameter_dict dynamic-template-mariadb-parameters
......
......@@ -9,7 +9,7 @@ log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
session.save_path = "{{ parameter_dict['tmp-dir'] }}"
session.save_path = "{{ apache_parameter_dict['tmp-dir'] }}"
session.auto_start = 0
date.timezone = {{ instance_dict.get('php.date.timezone', 'Europe/Paris') }}
file_uploads = On
......@@ -24,8 +24,8 @@ output_buffering = {{ instance_dict.get('php.output_buffering', 4096) }}
max_file_uploads = {{ instance_dict.get('php.max_file_uploads', 100) }}
#extension_dir="./"#
sys_temp_dir="{{ parameter_dict['tmp-dir'] }}"
upload_tmp_dir="{{ parameter_dict['php-upload-dir'] }}"
sys_temp_dir="{{ apache_parameter_dict['tmp-dir'] }}"
upload_tmp_dir="{{ apache_parameter_dict['php-upload-dir'] }}"
zend_extension=opcache
......@@ -48,7 +48,7 @@ apc.max_file_size=5M
apc.cache_by_default=1
apc.use_request_time=1
apc.slam_defense=0
apc.mmap_file_mask="{{ parameter_dict['tmp-dir'] }}/apc.XXXXXX"
apc.mmap_file_mask="{{ apache_parameter_dict['tmp-dir'] }}/apc.XXXXXX"
apc.stat_ctime=0
apc.canonicalize=1
apc.write_lock=1
......
......@@ -4,6 +4,7 @@ extends =
../../component/postfix/buildout.cfg
../../component/dovecot/buildout.cfg
# ../../component/mariadb/buildout.cfg
../../component/postgresql/buildout.cfg
../../stack/slapos.cfg
../../stack/monitor/buildout.cfg
../../stack/erp5/buildout.cfg
......@@ -15,8 +16,8 @@ parts =
slapos-cookbook
template
dovecot
postgresql
postfix
mariadb
[postfix]
......@@ -46,6 +47,7 @@ context =
# key xz_utils_location xz-utils:location
key template_monitor monitor2-template:output
key mariadb_link_binary template-mariadb:link-binary
key postgresql_location postgresql:location
key mariadb_location mariadb:location
key mariadb_resiliency_after_import_script mariadb-resiliency-after-import-script:target
key mariadb_slow_query_report_script mariadb-slow-query-report-script:target
......
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