From df0fe96f3419f8d8e858ae47651c56e89be883fd Mon Sep 17 00:00:00 2001 From: Rico Ullmann Date: Tue, 21 Dec 2021 17:36:34 +0100 Subject: [PATCH] postgresql: cleanup bundle --- bundles/postgresql/items.py | 22 --------------- bundles/postgresql/metadata.py | 49 ---------------------------------- 2 files changed, 71 deletions(-) diff --git a/bundles/postgresql/items.py b/bundles/postgresql/items.py index 5f21b42..873bd1d 100644 --- a/bundles/postgresql/items.py +++ b/bundles/postgresql/items.py @@ -8,13 +8,6 @@ pkg_apt = { '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 = { '/etc/postgresql': { '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 = { 'root': { 'password': repo.vault.password_for('{} postgresql root'.format(node.name)), diff --git a/bundles/postgresql/metadata.py b/bundles/postgresql/metadata.py index 6a76107..56f5015 100644 --- a/bundles/postgresql/metadata.py +++ b/bundles/postgresql/metadata.py @@ -7,15 +7,6 @@ defaults = { 'bash_functions': { 'pg_query_mon': "watch -n 2 \"echo \\\"SELECT pid, age(clock_timestamp(), query_start), usename, query FROM pg_stat_activity WHERE query != '' 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': { 'max_connections': 100, '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( 'apt/repos/postgresql', @@ -74,7 +26,6 @@ else: def default_postgresql_version_for_debian(metadata): # versions_in_debian = { - '10': '11', # buster '11': '13', # bullseye } os = str(node.os_version[0])