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,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…
Add table
Add a link
Reference in a new issue