From 2b06c6a39acfb4e07e2756667380d92e63500c5c Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Wed, 10 Jul 2024 16:26:32 +0100 Subject: [PATCH] Support setting whether an Apt repo is trusted Useful if you're configuring your own private repos, and don't/can't sign them. Change-Id: I2d592c5479530b2fe9a60c14ee59e817b8402490 --- ansible/roles/apt/templates/kayobe.sources.j2 | 3 +++ doc/source/configuration/reference/hosts.rst | 1 + .../notes/apt-configure-trust-for-repos-e2d379b5f5a4ec30.yaml | 4 ++++ 3 files changed, 8 insertions(+) create mode 100644 releasenotes/notes/apt-configure-trust-for-repos-e2d379b5f5a4ec30.yaml diff --git a/ansible/roles/apt/templates/kayobe.sources.j2 b/ansible/roles/apt/templates/kayobe.sources.j2 index 91f6bf6b4..b63f600de 100644 --- a/ansible/roles/apt/templates/kayobe.sources.j2 +++ b/ansible/roles/apt/templates/kayobe.sources.j2 @@ -11,5 +11,8 @@ Signed-by: {{ apt_keys_path }}/{{ repo.signed_by }} {% if repo.architecture is defined %} Architecture: {{ repo.architecture }} {% endif %} +{% if repo.trusted is defined %} +Trusted: {{ repo.trusted | bool }} +{% endif %} {% endfor %} diff --git a/doc/source/configuration/reference/hosts.rst b/doc/source/configuration/reference/hosts.rst index e69de543d..975b216cf 100644 --- a/doc/source/configuration/reference/hosts.rst +++ b/doc/source/configuration/reference/hosts.rst @@ -376,6 +376,7 @@ items: ``apt_keys_path`` (optional, default is unset) * ``architecture``: whitespace-separated list of architectures that will be used (optional, default is unset) +* ``trusted``: boolean value (optional, default is unset) The default of ``apt_repositories`` is an empty list. diff --git a/releasenotes/notes/apt-configure-trust-for-repos-e2d379b5f5a4ec30.yaml b/releasenotes/notes/apt-configure-trust-for-repos-e2d379b5f5a4ec30.yaml new file mode 100644 index 000000000..2aec2c35a --- /dev/null +++ b/releasenotes/notes/apt-configure-trust-for-repos-e2d379b5f5a4ec30.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Adds support for setting whether an Apt repo is trusted.