make some bundles arch-compatible, more default packages for arch

This commit is contained in:
Franzi 2021-05-23 12:24:00 +02:00
parent c136c33a58
commit 5a182fadef
Signed by: kunsi
GPG key ID: 12E3D2136B818350
12 changed files with 170 additions and 35 deletions

View file

@ -115,7 +115,16 @@ pkg_apt = {
'nmap': {},
'python3': {},
'python3-dev': {},
'python3-pip': {},
'python3-setuptools': {
'needed_by': {
'pkg_pip:',
},
},
'python3-pip': {
'needed_by': {
'pkg_pip:',
},
},
'python3-virtualenv': {},
'rsync': {},
'tar': {},

View file

@ -1,5 +1,13 @@
from bundlewrap.exceptions import BundleError
defaults = {
'pacman': {
'packages': {
'iptables': {},
},
},
}
@metadata_reactor.provides(
'iptables/bundle_rules/iptables',
)

View file

@ -6,18 +6,78 @@ if not node.os == 'arch':
# This is more targeted to GUI systems. This is intentional.
pkg_pacman = {
'fish': {},
'fwupd': {},
'at': {},
'autoconf': {},
'automake': {},
'binutils': {},
'bison': {},
'bzip2': {},
'curl': {},
'dialog': {},
'diffutils': {},
'fakeroot': {},
'file': {},
'findutils': {},
'flex': {},
'fwupd': {},
'gawk': {},
'gcc': {},
'gettext': {},
'git': {},
'gnu-netcat': {},
'grep': {},
'groff': {},
'gzip': {},
'ldns': {},
'less': {},
'libtool': {},
'linux': {},
'netctl': {},
'rfkill': {},
'logrotate': {},
'lsof': {},
'm4': {},
'mailutils': {},
'make': {},
'moreutils': {},
'mtr': {},
'ncdu': {},
'nmap': {},
'patch': {},
'pkgconf': {},
'python': {},
'python-setuptools': {
'needed_by': {
'pkg_pip:',
},
},
'python-pip': {
'needed_by': {
'pkg_pip:',
},
},
'python-virtualenv': {},
'rsync': {},
'sed': {},
'tar': {},
'texinfo': {},
'tmux': {},
'tree': {},
'unzip': {},
'vim': {},
'wpa_supplicant': {},
'wpa_actiond': {},
'lm_sensors': {},
'wget': {},
'which': {},
'whois': {},
'zip': {},
}
if node.metadata.get('pacman/install_gui', False):
pkg_pacman = {
'fish': {},
'netctl': {},
'rfkill': {},
'wpa_supplicant': {},
'wpa_actiond': {},
'lm_sensors': {},
}
for pkg, config in node.metadata.get('pacman/packages', {}).items():
pkg_pacman[pkg] = config

View file

@ -21,6 +21,12 @@ for identifier in node.metadata.get('postfix/mynetworks', set()):
netmask = '128'
mynetworks.add(f'[{ip6}]/{netmask}')
my_package = 'pkg_pacman:postfix' if node.has_bundle('pacman') else 'pkg_apt:postfix'
pkg_pip = {
'dnsq': {},
}
files = {
'/etc/mailname': {
'content': node.metadata.get('postfix/myhostname', node.metadata['hostname']),
@ -70,7 +76,7 @@ actions = {
'command': 'newaliases',
'triggered': True,
'needs': {
'pkg_apt:postfix',
my_package,
},
},
}
@ -80,7 +86,7 @@ svc_systemd = {
'needs': {
'file:/etc/postfix/master.cf',
'file:/etc/postfix/main.cf',
'pkg_apt:',
my_package,
},
},
}

View file

@ -4,7 +4,10 @@ defaults = {
'apt': {
'packages': {
'postfix': {},
'python3-dnsq': {},
'python3-dnsq': {
# handled by pkg_pip
'installed': False,
},
},
},
'icinga2_api': {
@ -19,6 +22,11 @@ defaults = {
},
},
},
'pacman': {
'packages': {
'postfix': {},
},
},
}
if node.has_bundle('postfixadmin'):

View file

@ -21,13 +21,6 @@ users = {
},
}
pkg_apt = {
'gawk': {}, # needed by check_ram
'libwww-perl': {}, # needed by check_nginx_status
'sysstat': {}, # needed by check_cpu_stats
'monitoring-plugins': {},
}
with open(join(repo.path, 'data', 'sshmon', 'sshmon.pub'), 'r') as fp:
pubkey = fp.read().strip()

View file

@ -3,7 +3,11 @@ from re import sub
defaults = {
'apt': {
'packages': {
'gawk': {}, # needed by check_ram
'libwww-perl': {}, # needed by check_nginx_status
'monitoring-plugins': {},
'python3-requests': {},
'sysstat': {}, # needed by check_cpu_stats
},
},
'icinga2_api': {
@ -23,6 +27,15 @@ defaults = {
'sshmon',
},
},
'pacman': {
'packages': {
'gawk': {},
'perl-libwww': {},
'monitoring-plugins': {},
'python-requests': {},
'sysstat': {},
},
},
}

View file

@ -19,3 +19,9 @@ files = {
'content_type': 'mako',
},
}
for filename, content in node.metadata.get('sudo/extra_configs', {}).items():
files[f'/etc/sudoers.d/{filename}'] = {
'content': '\n'.join(sorted(content)) + '\n',
'mode': '0440',
}

View file

@ -11,11 +11,24 @@ files = {
if node.metadata.get('systemd-networkd/enable-resolved', False):
symlinks['/etc/resolv.conf'] = {
'target': '/run/systemd/resolve/stub-resolv.conf',
'needed_by': {
'pkg_apt:',
'pkg_pacman:',
},
}
svc_systemd['systemd-resolved'] = {
'needed_by': {
'pkg_apt:',
'pkg_pacman:',
},
}
svc_systemd['systemd-resolved'] = {}
else:
files['/etc/resolv.conf'] = {
'content_type': 'mako',
'needed_by': {
'pkg_apt:',
'pkg_pacman:',
},
}

View file

@ -3,7 +3,9 @@ defaults = {
'packages': {
'libvirt-clients': {},
'libvirt-daemon-system': {},
'netcat-openbsd': {}, # for virt-manager
'qemu-utils': {},
'qemu-kvm': {},
'qemu-system-x86': {},
},
},
@ -21,3 +23,6 @@ defaults = {
},
},
}
if node.has_bundle('zfs'):
defaults['apt']['packages']['libvirt-daemon-driver-storage-zfs'] = {}