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,6 +169,7 @@ 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():
|
||||||
|
if 'items' in data:
|
||||||
files['/etc/apt/sources.list.d/{}.list'.format(name)] = {
|
files['/etc/apt/sources.list.d/{}.list'.format(name)] = {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'content': ("\n".join(sorted(data['items']))).format(
|
'content': ("\n".join(sorted(data['items']))).format(
|
||||||
|
@ -179,8 +180,30 @@ for name, data in node.metadata.get('apt/repos', {}).items():
|
||||||
'action:apt_update',
|
'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):
|
||||||
|
if 'items' in data:
|
||||||
files['/etc/apt/sources.list.d/{}.list'.format(name)]['needs'] = {
|
files['/etc/apt/sources.list.d/{}.list'.format(name)]['needs'] = {
|
||||||
'file:/etc/apt/trusted.gpg.d/{}.list.asc'.format(name),
|
'file:/etc/apt/trusted.gpg.d/{}.list.asc'.format(name),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue