From f1a693d0d62836c59878ab63d0dc548635299a3f Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 11 Apr 2020 11:25:24 +0200 Subject: [PATCH] bundles: only install apt packages via apt bundle to avoid double defining packages --- bundles/matrix-synapse/items.py | 4 ---- bundles/matrix-synapse/metadata.py | 3 +++ bundles/nginx/items.py | 3 --- bundles/nginx/metadata.py | 3 +++ bundles/nodejs/items.py | 4 ---- bundles/nodejs/metadata.py | 4 ++++ bundles/users/items.py | 5 ----- bundles/users/metadata.py | 10 ++++++++++ bundles/vmhost/items.py | 5 ----- bundles/vmhost/metadata.py | 11 +++++++++++ bundles/voc-loudness-monitor/items.py | 4 ---- bundles/voc-loudness-monitor/metadata.py | 5 +++++ 12 files changed, 36 insertions(+), 25 deletions(-) delete mode 100644 bundles/nginx/items.py delete mode 100644 bundles/nodejs/items.py create mode 100644 bundles/users/metadata.py delete mode 100644 bundles/vmhost/items.py create mode 100644 bundles/vmhost/metadata.py diff --git a/bundles/matrix-synapse/items.py b/bundles/matrix-synapse/items.py index e5b204b..bbe9157 100644 --- a/bundles/matrix-synapse/items.py +++ b/bundles/matrix-synapse/items.py @@ -1,7 +1,3 @@ -pkg_apt = { - 'matrix-synapse-py3': {} -} - files = { '/etc/matrix-synapse/homeserver.yaml': { 'content_type': 'mako', diff --git a/bundles/matrix-synapse/metadata.py b/bundles/matrix-synapse/metadata.py index 8fa5541..0002db3 100644 --- a/bundles/matrix-synapse/metadata.py +++ b/bundles/matrix-synapse/metadata.py @@ -15,6 +15,9 @@ def nodejs_apt_repos(metadata): 'packages.matrix.org', }, }, + 'packages': { + 'matrix-synapse-py3': {}, + }, }, }, DEFAULTS, DONE diff --git a/bundles/nginx/items.py b/bundles/nginx/items.py deleted file mode 100644 index 944b3f7..0000000 --- a/bundles/nginx/items.py +++ /dev/null @@ -1,3 +0,0 @@ -pkg_apt = { - 'nginx': {}, -} diff --git a/bundles/nginx/metadata.py b/bundles/nginx/metadata.py index 0cf3518..4f05fe4 100644 --- a/bundles/nginx/metadata.py +++ b/bundles/nginx/metadata.py @@ -15,5 +15,8 @@ def nginx_apt_repo(metadata): 'nginx.org', }, }, + 'packages': { + 'nginx': {}, + }, }, }, DEFAULTS, DONE diff --git a/bundles/nodejs/items.py b/bundles/nodejs/items.py deleted file mode 100644 index 2b1580d..0000000 --- a/bundles/nodejs/items.py +++ /dev/null @@ -1,4 +0,0 @@ -pkg_apt = { - 'yarn': {}, - 'nodejs': {}, -} diff --git a/bundles/nodejs/metadata.py b/bundles/nodejs/metadata.py index 4b15b82..9bd1f53 100644 --- a/bundles/nodejs/metadata.py +++ b/bundles/nodejs/metadata.py @@ -23,5 +23,9 @@ def nodejs_apt_repos(metadata): 'dl.yarnpkg.com', }, }, + 'packages': { + 'nodejs': {}, + 'yarn': {}, + }, }, }, DEFAULTS, DONE diff --git a/bundles/users/items.py b/bundles/users/items.py index c01553a..5a54d8c 100644 --- a/bundles/users/items.py +++ b/bundles/users/items.py @@ -5,11 +5,6 @@ users = {} files = {} groups = {} -pkg_apt = { - 'fish': {}, - 'tmux': {}, -} - users['root'] = { 'home': '/root', 'shell': '/bin/bash', diff --git a/bundles/users/metadata.py b/bundles/users/metadata.py new file mode 100644 index 0000000..d812d7f --- /dev/null +++ b/bundles/users/metadata.py @@ -0,0 +1,10 @@ +@metadata_processor +def apt(metadata): + return { + 'apt': { + 'packages': { + 'fish': {}, + 'tmux': {}, + }, + }, + }, DEFAULTS, DONE diff --git a/bundles/vmhost/items.py b/bundles/vmhost/items.py deleted file mode 100644 index 564f74f..0000000 --- a/bundles/vmhost/items.py +++ /dev/null @@ -1,5 +0,0 @@ -pkg_apt = { - 'qemu-kvm': {}, - 'libvirt-clients': {}, - 'libvirt-daemon-system': {}, -} diff --git a/bundles/vmhost/metadata.py b/bundles/vmhost/metadata.py new file mode 100644 index 0000000..f9850b4 --- /dev/null +++ b/bundles/vmhost/metadata.py @@ -0,0 +1,11 @@ +@metadata_processor +def apt(metadata): + return { + 'apt': { + 'packages': { + 'qemu-kvm': {}, + 'libvirt-clients': {}, + 'libvirt-daemon-system': {}, + }, + }, + }, DEFAULTS, DONE diff --git a/bundles/voc-loudness-monitor/items.py b/bundles/voc-loudness-monitor/items.py index ff70f0d..fcfcc7a 100644 --- a/bundles/voc-loudness-monitor/items.py +++ b/bundles/voc-loudness-monitor/items.py @@ -34,10 +34,6 @@ streams = { files = {} svc_systemd = {} -pkg_apt = { - 'ffmpeg': {}, -} - for stream_id, config in streams.items(): config['id'] = stream_id diff --git a/bundles/voc-loudness-monitor/metadata.py b/bundles/voc-loudness-monitor/metadata.py index 864fe83..82e4a2b 100644 --- a/bundles/voc-loudness-monitor/metadata.py +++ b/bundles/voc-loudness-monitor/metadata.py @@ -1,6 +1,11 @@ @metadata_processor def add_voc_user(metadata): return { + 'apt': { + 'packages': { + 'ffmpeg': {}, + }, + }, 'users': { 'voc': { 'home': '/opt/voc-loudness-monitor',