postgresql: cleanup bundle

This commit is contained in:
Rico 2021-12-21 17:36:34 +01:00
parent 592cacb7b8
commit df0fe96f34
Signed by: stillbeben
GPG key ID: AE1066B5BD0B5041
2 changed files with 0 additions and 71 deletions

View file

@ -8,13 +8,6 @@ pkg_apt = {
'postgresql-server-dev-{}'.format(postgresql_version): {} 'postgresql-server-dev-{}'.format(postgresql_version): {}
} }
if node.has_bundle('zfs'):
for pkgname, pkgconfig in pkg_apt.items():
pkg_apt[pkgname]['needs'] = {
'zfs_dataset:tank/postgresql',
}
directories = { directories = {
'/etc/postgresql': { '/etc/postgresql': {
'owner': None, 'owner': None,
@ -60,21 +53,6 @@ files = {
}, },
} }
if node.has_bundle('backup-client') and not node.has_bundle('zfs'):
files['/etc/backup-pre-hooks.d/90-postgresql-dump-all'] = {
'source': 'backup-pre-hook',
'content_type': 'mako',
'context': {
'databases': node.metadata.get('postgresql/databases', {}).keys(),
},
'mode': '0700',
}
directories['/var/tmp/postgresdumps'] = {}
else:
files['/var/tmp/postgresdumps'] = {
'delete': True,
}
postgres_roles = { postgres_roles = {
'root': { 'root': {
'password': repo.vault.password_for('{} postgresql root'.format(node.name)), 'password': repo.vault.password_for('{} postgresql root'.format(node.name)),

View file

@ -7,15 +7,6 @@ defaults = {
'bash_functions': { 'bash_functions': {
'pg_query_mon': "watch -n 2 \"echo \\\"SELECT pid, age(clock_timestamp(), query_start), usename, query FROM pg_stat_activity WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' ORDER BY query_start desc;\\\" | psql postgres\"" 'pg_query_mon': "watch -n 2 \"echo \\\"SELECT pid, age(clock_timestamp(), query_start), usename, query FROM pg_stat_activity WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' ORDER BY query_start desc;\\\" | psql postgres\""
}, },
'icinga2_api': {
'postgresql': {
'services': {
'POSTGRESQL PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C postgres -c 1:',
},
},
},
},
'postgresql': { 'postgresql': {
'max_connections': 100, 'max_connections': 100,
'autovacuum_max_workers': 3, 'autovacuum_max_workers': 3,
@ -27,45 +18,6 @@ defaults = {
}, },
} }
if node.has_bundle('telegraf'):
defaults['telegraf'] = {
'input_plugins': {
'builtin': {
'postgresql': [{
'address': repo.vault.password_for(f'{node.name} postgresql telegraf').format_into('postgres://telegraf:{}@localhost:5432/telegraf?sslmode=disable'),
'ignored_databases': [
'template0',
'template1',
'telegraf',
],
}],
},
},
}
defaults['postgresql'].update({
'roles': {
'telegraf': {
'password': repo.vault.password_for(f'{node.name} postgresql telegraf'),
},
},
'databases': {
'telegraf': {
'owner': 'telegraf',
},
},
})
if node.has_bundle('zfs'):
defaults['zfs'] = {
'datasets': {
'tank/postgresql': {
'mountpoint': '/var/lib/postgresql',
},
},
}
else:
defaults['backups']['paths'].add('/var/tmp/postgresdumps')
@metadata_reactor.provides( @metadata_reactor.provides(
'apt/repos/postgresql', 'apt/repos/postgresql',
@ -74,7 +26,6 @@ else:
def default_postgresql_version_for_debian(metadata): def default_postgresql_version_for_debian(metadata):
# <https://packages.debian.org/search?keywords=postgresql> # <https://packages.debian.org/search?keywords=postgresql>
versions_in_debian = { versions_in_debian = {
'10': '11', # buster
'11': '13', # bullseye '11': '13', # bullseye
} }
os = str(node.os_version[0]) os = str(node.os_version[0])