bundles/apt: use node.os and node.os_version to determine settings
This commit is contained in:
parent
880184807b
commit
b690ae25b0
3 changed files with 29 additions and 4 deletions
|
@ -1,6 +1,10 @@
|
|||
Unattended-Upgrade::Origins-Pattern {
|
||||
"origin=Debian,codename=${node.metadata['os_release']},label=Debian";
|
||||
"origin=Debian,codename=${node.metadata['os_release']},label=Debian-Security";
|
||||
"origin=Debian,codename=${os_release},label=Debian";
|
||||
"origin=Debian,codename=${os_release},label=Debian-Security";
|
||||
|
||||
% if node_has_backports:
|
||||
"a=${os_release}-backports,n=${os_release}-backports";
|
||||
% endif
|
||||
|
||||
// External packages
|
||||
% for item in sorted(data.get('origins', set())):
|
||||
|
|
3
bundles/apt/files/sources.list-buster
Normal file
3
bundles/apt/files/sources.list-buster
Normal file
|
@ -0,0 +1,3 @@
|
|||
deb http://deb.debian.org/debian/ buster main non-free contrib
|
||||
deb http://security.debian.org/debian-security buster/updates main contrib non-free
|
||||
deb http://deb.debian.org/debian/ buster-updates main contrib non-free
|
|
@ -1,3 +1,12 @@
|
|||
supported_os = {
|
||||
'debian': {
|
||||
10: 'buster',
|
||||
},
|
||||
}
|
||||
|
||||
assert supported_os[node.os][node.os_version[0]], '{}: OS {} {} is not supported by bundle:apt'.format(node.name, node.os, node.os_version)
|
||||
|
||||
|
||||
actions = {
|
||||
'apt_update': {
|
||||
'command': 'apt-get update',
|
||||
|
@ -13,7 +22,11 @@ files = {
|
|||
'/etc/apt/apt.conf.d/50unattended-upgrades': {
|
||||
'content_type': 'mako',
|
||||
'source': 'apt.conf-unattended-upgrades',
|
||||
'context': {'data': node.metadata.get('apt', {}).get('unattended-upgrades', {})}
|
||||
'context': {
|
||||
'data': node.metadata.get('apt', {}).get('unattended-upgrades', {}),
|
||||
'node_has_backports': ('backports' in node.metadata.get('apt', {}).get('repos', {})),
|
||||
'os_release': supported_os[node.os][node.os_version[0]],
|
||||
}
|
||||
},
|
||||
'/etc/apt/apt.conf.d/20auto-upgrades': {
|
||||
'source': 'apt.conf-auto-upgrades',
|
||||
|
@ -27,10 +40,15 @@ files = {
|
|||
'/var/lib/cloud': {
|
||||
'delete': True,
|
||||
},
|
||||
'/etc/apt/sources.list': {
|
||||
'source': 'sources.list-{}'.format(supported_os[node.os][node.os_version[0]]),
|
||||
},
|
||||
}
|
||||
|
||||
directories = {
|
||||
'/etc/apt/sources.list.d': {},
|
||||
'/etc/apt/sources.list.d': {
|
||||
'purge': True,
|
||||
},
|
||||
}
|
||||
|
||||
pkg_apt = {
|
||||
|
|
Loading…
Reference in a new issue