release -> codename

This commit is contained in:
cronekorkn 2023-03-31 21:48:32 +02:00
parent b3399e4db5
commit e54ec9bb35
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw
9 changed files with 16 additions and 16 deletions

View file

@ -68,7 +68,7 @@ for host, sources in hosts.items():
files[f'/etc/apt/sources.list.d/{host}.list'] = {
'content': '\n'.join(sorted(set(
str(source).format(
release=node.metadata.get('os_release'),
codename=node.metadata.get('os_codename'),
version=node.os_version[0], # WIP crystal
)
for source in sources
@ -95,7 +95,7 @@ for package, options in node.metadata.get('apt/packages', {}).items():
files[f'/etc/apt/preferences.d/{package}'] = {
'content': '\n'.join([
f"Package: {package}",
f"Pin: release a={node.metadata.get('os_release')}-backports",
f"Pin: release a={node.metadata.get('os_codename')}-backports",
f"Pin-Priority: 900",
]),
'needed_by': [

View file

@ -9,7 +9,7 @@ defaults = {
'monitoring-plugins': {},
},
'sources': {
'deb https://packages.icinga.com/debian icinga-{release} main',
'deb https://packages.icinga.com/debian icinga-{codename} main',
},
},
'icinga2': {

View file

@ -14,7 +14,7 @@ defaults = {
'icingaweb2-module-monitoring': {},
},
'sources': {
'deb https://packages.icinga.com/debian icinga-{release} main',
'deb https://packages.icinga.com/debian icinga-{codename} main',
},
},
'icingaweb2': {

View file

@ -7,7 +7,7 @@ defaults = {
'influxdb2-cli': {},
},
'sources': {
'deb https://repos.influxdata.com/debian {release} stable',
'deb https://repos.influxdata.com/debian {codename} stable',
},
},
'nftables': {

View file

@ -23,8 +23,8 @@ def sources(metadata):
return {
'apt': {
'sources': {
f'deb https://deb.nodesource.com/node_{version}.x {{release}} main',
f'deb-src https://deb.nodesource.com/node_{version}.x {{release}} main',
f'deb https://deb.nodesource.com/node_{version}.x {{codename}} main',
f'deb-src https://deb.nodesource.com/node_{version}.x {{codename}} main',
},
},
}

View file

@ -95,11 +95,11 @@ defaults = {
'apt/sources',
)
def apt(metadata):
release = {
codename = {
'buster': 'buster',
'bullseye': 'bullseye',
'bookworm': 'bullseye',
}[metadata.get('os_release')]
}[metadata.get('os_codename')]
return {
'apt': {
@ -107,7 +107,7 @@ def apt(metadata):
'telegraf': {},
},
'sources': {
f"deb https://repos.influxdata.com/debian {release} stable",
f"deb https://repos.influxdata.com/debian {codename} stable",
},
},
}

View file

@ -9,7 +9,7 @@
'postgresql': {
'version': '13',
},
'os_release': 'bullseye',
'os_codename': 'bullseye',
},
'os_version': (11,),
}

View file

@ -9,7 +9,7 @@
'postgresql': {
'version': '14',
},
'os_release': 'bookworm',
'os_codename': 'bookworm',
},
'os_version': (12,),
}

View file

@ -10,10 +10,10 @@
'metadata': {
'apt': {
'sources': {
'deb https://deb.debian.org/debian {release} main contrib non-free',
'deb https://deb.debian.org/debian {release}-updates main contrib non-free',
'deb https://deb.debian.org/debian {release}-backports main contrib non-free',
'deb https://security.debian.org/ {release}-security main contrib non-free',
'deb https://deb.debian.org/debian {codename} main contrib non-free',
'deb https://deb.debian.org/debian {codename}-updates main contrib non-free',
'deb https://deb.debian.org/debian {codename}-backports main contrib non-free',
'deb https://security.debian.org/ {codename}-security main contrib non-free',
},
'packages': {
'mtr-tiny': {},