bundles/postgresql: some improvements

This commit is contained in:
Franzi 2023-07-14 05:45:26 +02:00
parent 54d0c42da6
commit 76eef92ee2
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 11 additions and 30 deletions

View file

@ -27,7 +27,7 @@ log_min_duration_statement = -1
% endif % endif
effective_io_concurrency = ${effective_io_concurrency} effective_io_concurrency = ${effective_io_concurrency}
max_worker_processes = ${max_worker_processes} max_worker_processes = ${max_worker_processes}
% if version_list >= [10]: % if version >= 10:
max_parallel_workers = ${max_parallel_workers} max_parallel_workers = ${max_parallel_workers}
% endif % endif
max_parallel_workers_per_gather = ${max_parallel_workers_per_gather} max_parallel_workers_per_gather = ${max_parallel_workers_per_gather}

View file

@ -45,7 +45,7 @@ files = {
"/etc/postgresql/{}/main/postgresql.conf".format(postgresql_version): { "/etc/postgresql/{}/main/postgresql.conf".format(postgresql_version): {
'content_type': 'mako', 'content_type': 'mako',
'context': { 'context': {
'version_list': [int(i) for i in node.metadata['postgresql']['version'].split('.')], 'version': postgresql_version,
**node.metadata['postgresql'], **node.metadata['postgresql'],
}, },
'owner': 'postgres', 'owner': 'postgres',

View file

@ -1,4 +1,13 @@
defaults = { defaults = {
'apt': {
'repos': {
'postgresql': {
'items': {
'deb https://apt.postgresql.org/pub/repos/apt/ {os_release}-pgdg main',
},
},
},
},
'backups': { 'backups': {
'paths': { 'paths': {
'/var/lib/postgresql', '/var/lib/postgresql',
@ -69,34 +78,6 @@ else:
defaults['backups']['paths'].add('/var/tmp/postgresdumps') defaults['backups']['paths'].add('/var/tmp/postgresdumps')
@metadata_reactor.provides(
'apt/repos/postgresql',
)
def default_postgresql_version_for_debian(metadata):
# <https://packages.debian.org/search?keywords=postgresql>
versions_in_debian = {
'10': '11', # buster
'11': '13', # bullseye
}
os = str(node.os_version[0])
version_to_be_installed = metadata.get('postgresql/version')
if version_to_be_installed != versions_in_debian[os]:
return {
'apt': {
'repos': {
'postgresql': {
'items': {
'deb https://apt.postgresql.org/pub/repos/apt/ {os_release}-pgdg main',
},
},
},
},
}
return {}
@metadata_reactor.provides( @metadata_reactor.provides(
'postgresql/effective_io_concurrency', 'postgresql/effective_io_concurrency',
'postgresql/max_worker_processes', 'postgresql/max_worker_processes',