← Back to team overview

curtin-dev team mailing list archive

Re: [Merge] ~tiago.pasqualini/curtin:fix_doc into curtin:master

 

Thanks for the suggestions, these are nice.  Don't worry about the AMD64 ci failure, we're investigating and this is clearly unrelated to this MP, we can merge without waiting for that bit.

Diff comments:

> diff --git a/doc/topics/apt_source.rst b/doc/topics/apt_source.rst
> index 2a4616e..27ca1d8 100644
> --- a/doc/topics/apt_source.rst
> +++ b/doc/topics/apt_source.rst
> @@ -205,6 +205,55 @@ This is a collection of additional ideas people can use the feature for customiz
>           Suites: $RELEASE $RELEASE-updates $RELEASE-security $RELEASE-proposed
>           Components: main restricted universe multiverse
>  
> +Using templates
> +~~~~~~~~~~~~~~~
> +
> +Curtin supports the usage of custom templates for rendering ``sources.list`` or ``ubuntu.sources``.
> +If a template is not provided, curtin will try to modify the ``sources.list`` (or ``ubuntu.sources`` in the case of deb822) in the target at
> +``/etc/apt/sources.list`` (or ``/etc/apt/sources.list.d/ubuntu.sources`` in the case of deb822). Within these templates you can use the following
> +replacement variables: ``$RELEASE, $MIRROR, $PRIMARY, $SECURITY``.
> +
> +The following example uses a template to change the GPG key for a particular mirror (in this case what is defined as ``$PRIMARY``):

I want to tweak the phrasing a bit - the template function is somewhat unrelated to the key, but all of this is good to improve documentation on.  A key pgp block can be supplied without using the replacement variables, I don't want to make it sound like the two are required together.

WDYT about:

"The following example configures ubuntu.sources in deb822 format, supplies a custom GPG key, and uses the template feature to genericise the configuration across releases."

> +
> +::
> +
> + apt:
> +   primary:
> +     - arches: [amd64, i386, default]
> +       uri: http://mymirror.local/ubuntu
> +   sources_list: |
> +     Types: deb
> +     URIs: $PRIMARY
> +     Suites: $RELEASE $RELEASE-updates $RELEASE-security $RELEASE-proposed
> +     Components: main
> +     key: | # full key as block
> +       -----BEGIN PGP PUBLIC KEY BLOCK-----
> +       Version: GnuPG v1
> +       mQGiBEFEnz8RBAC7LstGsKD7McXZgd58oN68KquARLBl6rjA2vdhwl77KkPPOr3O
> +       RwIbDAAKCRBAl26vQ30FtdxYAJsFjU+xbex7gevyGQ2/mhqidES4MwCggqQyo+w1
> +       Twx6DKLF+3rF5nf1F3Q=
> +       =PBAe
> +       -----END PGP PUBLIC KEY BLOCK-----
> +
> +The template above will result in the following ``ubuntu.sources`` file:
> +
> +::
> +
> + Types: deb
> + URIs: http://mymirror.local/ubuntu
> + Suites: noble noble-updates noble-security noble-backports
> + Components: main
> + Signed-By: | # full key as block
> +   -----BEGIN PGP PUBLIC KEY BLOCK-----
> +   Version: GnuPG v1
> +   mQGiBEFEnz8RBAC7LstGsKD7McXZgd58oN68KquARLBl6rjA2vdhwl77KkPPOr3O
> +   RwIbDAAKCRBAl26vQ30FtdxYAJsFjU+xbex7gevyGQ2/mhqidES4MwCggqQyo+w1
> +   Twx6DKLF+3rF5nf1F3Q=
> +   =PBAe
> +   -----END PGP PUBLIC KEY BLOCK-----
> +
> +The file ``apt-source.yaml`` holds more examples on how to use templates.

Suggest linking to it, and let's link to github as I want to move curtin to primarily be on github soonish.  https://github.com/canonical/curtin/blob/master/examples/apt-source.yaml

> +
>  Timing
>  ~~~~~~
>  The feature is implemented at the stage of curthooks_commands, which runs just after curtin has extracted the image to the target.


-- 
https://code.launchpad.net/~tiago.pasqualini/curtin/+git/curtin/+merge/473681
Your team curtin developers is requested to review the proposed merge of ~tiago.pasqualini/curtin:fix_doc into curtin:master.



References