← Back to team overview

cloud-init team mailing list archive

Re: Apt configure module with multiple architectures


Hi Brett,

Thank you for sharing the example. I have seen it, and it is a bit
different to what I'm hoping to do. What's happening in the example with
regards to arches, as far as I can tell, is a different set of apt sources
are specified when the cloudinit config is applied on different arches.
i.e. If you apply on amd64 you get source
http://us.archive.ubuntu.com/ubuntu as the primary, but if you apply
on arm64 you get the default from whatever template or image is in use.

What I'm hoping to do is to set up the apt sources to support multiple
architectures. The goal is to have the config for the default arch for the
hardware to be applied, but then also other foreign arches to also be
configured in the sources.list. For example, if the hardware is amd64 I
hope to configure sources for both amd64 and arm64 where both have
qualifiers "deb [arch=amd64]" and "deb [arch=arm64]". I can sort of achieve
this by manually specifying the sources_list value to include a hardcoded
set of deb lines for both architectures and with the URLs hardcoded in the
list. What I hope to do is not have to hardcode the URLs for each
architecture since the template already knows what they are.

I don't believe this is possible, but I might be missing something.

Maybe it'd be possible for the apt configure module to accept a list of
foreign architectures that should be apt configured alongside the system's
architecture. I'd be interested to know if anyone else would find this
valuable or if this is a niche use case.


On Mon, Jan 24, 2022 at 2:52 PM Brett Holman <brett.holman@xxxxxxxxxxxxx>

> Hi Leigh,
> The comments in this example
> <https://cloudinit.readthedocs.io/en/latest/topics/examples.html#additional-apt-configuration-and-repositories>
> are probably a good starting point if you haven't seen them already.
> It has keywords for specifying trusted keys/source files, as well as
> specifying mirrors (primary/security/etc) on a per-arch basis.
> I haven't personally used the architecture code, so I can't give further
> detail without digging in myself.
> Hopefully that helps.
> Cheers,
> Brett Holman
> On Sat, Jan 22, 2022 at 11:59 PM Leigh McCulloch <leigh@xxxxxxxxxxxx>
> wrote:
>> Hi,
>> Is there a recommended approach to using the apt configure module to
>> setup an instance for multiple-architectures? For example, is there a way
>> to use apt configure to setup both amd64 and arm64 source lists with arch
>> qualifiers?
>> My current approach is to use the write_files module to manually write
>> out sources to the sources.list.d directory, however this seems like
>> something that the apt configure module would be well suited to supporting
>> if there was to specify additional foreign architectures to setup sources
>> for. Is there always a way to do this?
>> Thanks!
>> Leigh
>> --
>> Mailing list: https://launchpad.net/~cloud-init
>> Post to     : cloud-init@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~cloud-init
>> More help   : https://help.launchpad.net/ListHelp