bundles/apt: suport deb822-style sources
This commit is contained in:
parent
787607b5a1
commit
74baeb4bf4
2 changed files with 45 additions and 13 deletions
9
bundles/apt/files/deb822-sources
Normal file
9
bundles/apt/files/deb822-sources
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
% for uri in sorted(uris):
|
||||||
|
Types: ${' '.join(sorted(data.get('types', {'deb'})))}
|
||||||
|
URIs: ${uri}
|
||||||
|
Suites: ${os_release}
|
||||||
|
Components: ${' '.join(sorted(data.get('components', {'main'})))}
|
||||||
|
Architectures: ${' '.join(sorted(data.get('architectures', {'amd64'})))}
|
||||||
|
Signed-By: /etc/apt/trusted.gpg.d/${name}.list.asc
|
||||||
|
|
||||||
|
% endfor
|
|
@ -169,21 +169,44 @@ if node.os_version[0] >= 11:
|
||||||
}
|
}
|
||||||
|
|
||||||
for name, data in node.metadata.get('apt/repos', {}).items():
|
for name, data in node.metadata.get('apt/repos', {}).items():
|
||||||
files['/etc/apt/sources.list.d/{}.list'.format(name)] = {
|
if 'items' in data:
|
||||||
'content_type': 'mako',
|
files['/etc/apt/sources.list.d/{}.list'.format(name)] = {
|
||||||
'content': ("\n".join(sorted(data['items']))).format(
|
'content_type': 'mako',
|
||||||
os=node.os,
|
'content': ("\n".join(sorted(data['items']))).format(
|
||||||
os_release=supported_os[node.os][node.os_version[0]],
|
os=node.os,
|
||||||
),
|
os_release=supported_os[node.os][node.os_version[0]],
|
||||||
'triggers': {
|
),
|
||||||
'action:apt_update',
|
'triggers': {
|
||||||
},
|
'action:apt_update',
|
||||||
}
|
},
|
||||||
|
}
|
||||||
|
elif 'uris' in data:
|
||||||
|
uris = {
|
||||||
|
x.format(
|
||||||
|
os=node.os,
|
||||||
|
os_release=supported_os[node.os][node.os_version[0]],
|
||||||
|
) for x in data['uris']
|
||||||
|
}
|
||||||
|
|
||||||
|
files['/etc/apt/sources.list.d/{}.sources'.format(name)] = {
|
||||||
|
'source': 'deb822-sources',
|
||||||
|
'content_type': 'mako',
|
||||||
|
'context': {
|
||||||
|
'data': data,
|
||||||
|
'name': name,
|
||||||
|
'os_release': supported_os[node.os][node.os_version[0]],
|
||||||
|
'uris': uris,
|
||||||
|
},
|
||||||
|
'triggers': {
|
||||||
|
'action:apt_update',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
if data.get('install_gpg_key', True):
|
if data.get('install_gpg_key', True):
|
||||||
files['/etc/apt/sources.list.d/{}.list'.format(name)]['needs'] = {
|
if 'items' in data:
|
||||||
'file:/etc/apt/trusted.gpg.d/{}.list.asc'.format(name),
|
files['/etc/apt/sources.list.d/{}.list'.format(name)]['needs'] = {
|
||||||
}
|
'file:/etc/apt/trusted.gpg.d/{}.list.asc'.format(name),
|
||||||
|
}
|
||||||
|
|
||||||
files['/etc/apt/trusted.gpg.d/{}.list.asc'.format(name)] = {
|
files['/etc/apt/trusted.gpg.d/{}.list.asc'.format(name)] = {
|
||||||
'source': 'gpg-keys/{}.asc'.format(name),
|
'source': 'gpg-keys/{}.asc'.format(name),
|
||||||
|
|
Loading…
Reference in a new issue