Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions cloudinit/config/cc_apt_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
distros = ["ubuntu", "debian"]
mirror_property = {
'type': 'array',
'item': {
'items': {
'type': 'object',
'additionalProperties': False,
'required': ['arches'],
'properties': {
'arches': {
'type': 'array',
'item': {
'items': {
'type': 'string'
},
'minItems': 1
Expand All @@ -54,7 +54,7 @@
},
'search': {
'type': 'array',
'item': {
'items': {
'type': 'string',
'format': 'uri'
},
Expand Down Expand Up @@ -113,11 +113,12 @@
search:
- 'http://cool.but-sometimes-unreachable.com/ubuntu'
- 'http://us.archive.ubuntu.com/ubuntu'
search_dns: <true/false>
search_dns: false
- arches:
- s390x
- arm64
uri: 'http://archive-to-use-for-arm64.example.com/ubuntu'

security:
- arches:
- default
Expand Down Expand Up @@ -260,7 +261,8 @@
``http://archive.ubuntu.com/ubuntu``.
- ``security`` => \
``http://security.ubuntu.com/ubuntu``
""")},
""")
},
'security': {
**mirror_property,
'description': dedent("""\
Expand Down Expand Up @@ -380,6 +382,7 @@
- ``key``: a raw PGP key.
- ``keyserver``: alternate keyserver to pull \
``keyid`` key from.
- ``filename``: specify the name of the .list file

The ``source`` key supports variable
replacements for the following strings:
Expand Down Expand Up @@ -1040,7 +1043,7 @@ def get_arch_mirrorconfig(cfg, mirrortype, arch):
# select the specification matching the target arch
default = None
for mirror_cfg_elem in mirror_cfg_list:
arches = mirror_cfg_elem.get("arches", [])
arches = mirror_cfg_elem.get("arches") or []
if arch in arches:
return mirror_cfg_elem
if "default" in arches:
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/cloud-config-apt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ apt:
# security is optional, if not defined it is set to the same value as primary
security:
- uri: http://security.ubuntu.com/ubuntu
- arches: [default]
arches: [default]
# If search_dns is set for security the searched pattern is:
# <distro>-security-mirror

Expand Down