bundles/postgresql: improvements
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
- support other postgresql versions - manage configs using bw
This commit is contained in:
parent
7f36516faa
commit
a160e7cf46
5 changed files with 224 additions and 12 deletions
|
@ -1,19 +1,56 @@
|
|||
postgresql_version = node.metadata['postgresql']['version']
|
||||
|
||||
pkg_apt = {
|
||||
'postgresql-11': {},
|
||||
'postgresql-client-11': {},
|
||||
'postgresql-server-dev-11': {},
|
||||
'postgresql-common': {},
|
||||
'postgresql-client-common': {},
|
||||
'postgresql-{}'.format(postgresql_version): {},
|
||||
'postgresql-client-{}'.format(postgresql_version): {},
|
||||
'postgresql-server-dev-{}'.format(postgresql_version): {},
|
||||
}
|
||||
|
||||
if node.has_bundle('zfs'):
|
||||
pkg_apt['postgresql-11']['needs'] = {
|
||||
'zfs_dataset:tank/postgresql',
|
||||
}
|
||||
pkg_apt['postgresql-client-11']['needs'] = {
|
||||
'zfs_dataset:tank/postgresql',
|
||||
}
|
||||
pkg_apt['postgresql-server-dev-11']['needs'] = {
|
||||
'zfs_dataset:tank/postgresql',
|
||||
}
|
||||
for pkgname, pkgconfig in pkg_apt.items():
|
||||
pkg_apt[pkgname]['needs'] = {
|
||||
'zfs_dataset:tank/postgresql',
|
||||
}
|
||||
|
||||
|
||||
directories = {
|
||||
'/etc/postgresql': {
|
||||
'owner': None,
|
||||
'group': None,
|
||||
'mode': None,
|
||||
# Keeping old configs messes with cluster-auto-detection.
|
||||
'purge': True,
|
||||
},
|
||||
# This is needed so the above purge does not remove the version
|
||||
# currently installed.
|
||||
'/etc/postgresql/{}'.format(postgresql_version): {
|
||||
'owner': None,
|
||||
'group': None,
|
||||
'mode': None,
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
"/etc/postgresql/{}/main/pg_hba.conf".format(postgresql_version): {
|
||||
'content_type': 'mako',
|
||||
'owner': 'postgres',
|
||||
'group': 'postgres',
|
||||
'triggers': {
|
||||
'svc_systemd:postgresql:restart',
|
||||
},
|
||||
},
|
||||
"/etc/postgresql/{}/main/postgresql.conf".format(postgresql_version): {
|
||||
'content_type': 'mako',
|
||||
'context': node.metadata['postgresql'],
|
||||
'owner': 'postgres',
|
||||
'group': 'postgres',
|
||||
'triggers': {
|
||||
'svc_systemd:postgresql:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
postgres_roles = {
|
||||
'root': {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue