/srv/irclogs.ubuntu.com/2022/04/29/#cloud-init.txt

=== Guest44454 is now known as ice10001
ice10001Hi all, anyone able to help with adding repositories (apt) to my custom user-data file, & updating, then installing latest software?03:35
holmanbice10001: hello, did you see/test the issue blackboxsw pointed out yesterday?14:30
minimalholmanb: re the Alpine lxc chat the other day, you are using lxc (container) rather than lxd (vm), right? I find the current lxc/lxd situation confusing due to the somewhat interchangable use of the 2 terms14:32
holmanbminimal: I find it just as confusing tbh - I was using them interchangably, since the lxc command can by used to initialize both iirc14:32
holmanbminimal: but yes, I ususually use it for containers, only vms occasionally with lx[cd]14:33
amessyroomI'm learning cloud-init and am having some confusing on the difference of /etc/cloud.cfg and the files in /etc/cloud.cfg.d . Does the /etc/cloud.cfg define which modules to run; and then the details (parameters) are defined in individual files in cloud.cfg.d ? It seems when the system boot it says it cannot find anything to do; but I have multiple files in /etc/cloud.cfg.d and have also tried concating these files into /etc/cloud/clooud.c14:33
minimalholmanb: yeah, from a cloud-init perspective it seems that LXD (vm) uses LXD datasource, whereas lxc (container) uses NoCloud datasource14:33
holmanbminimal: I think lxd datasource supports both14:35
minimalamessyroom: generally you specify "what to do" in the user-data / meta-data / network-config rather than in those files14:35
amessyroomhmmm. but can user data be pre-created into the image, rather than pasted into a gui dialogue box i.e. azure . I'm trying to make a gold image that will build swap; register rh; update packages; and don't want to paste commands or put it in a file and have to pass it as a parameter. 14:38
amessyroomi've not used user data; but just read there is a user-data area in /var/lib/cloud/seed/<datasource>/user-data so being azure will be my datasource I guess I can put things there ? 14:39
minimalamessyroom: yes, seeds files are AFAIK a way to achieve what you want14:41
minimalfrom https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html?highlight=seed#what-is-instance-data "cloud-config seed files in the booted cloud image or distribution"14:41
amessyroomthanks. i'll give that a try. kinda confusing it seems you have multiple ways to do things but user-data seems to be the most used; trying to follow microsoft azure docs and have find that although helpful don't seem to have everything you need to understand to implement :-(14:45
minimalamessyroom: the reason for multiple ways is to provide flexibility. The "normal" method is user user-data which you provide via the cloud provider (UI/API/etc) when an instance/VM is created14:52
minimalthe files in /etc/cloud.cfg and /etc/cloud.cfg.d are generally for enabling/disabling c-i modules and other generate setup, not for providing data to them14:52
minimals/generate/general/14:53
falcojrminimal and holmanb: descriptions here might be helpful: https://linuxcontainers.org/15:03
falcojrin particular, "LXC provides the basic functionality used under the hood by LXD. However, it should not be confused with the lxc CLI client tool provided by LXD."15:03
falcojrso any `lxc <command>` is actually using LXD (which under the hood is using LXC)...clear as mud, right?15:04
holmanbfalcojr: thanks :)15:12
Gordon85Hi there16:51
Gordon85could someone help me with an issue?16:51
Gordon85I know that in cloud-config I can refer to gpg url for yum with:  gpgkey: <url>16:53
Gordon85and that works16:53
Gordon85but ... how do I do it for apt?16:53
Gordon85I've tried with gpgkey: ..., and also with key_url: ... and it failed both times16:54
Gordon85this is my apt section on #cloud-config16:54
Gordon85apt:16:55
Gordon85  sources:16:55
Gordon85    python3:16:55
Gordon85     - source: "ppa:deadsnakes/ppa"16:55
Gordon85    terraform:16:55
Gordon85      source: "deb [arch=amd64] https://apt.releases.hashicorp.com $RELEASE main"16:55
Gordon85      file: /etc/apt/sources.list.d/hashicorp.list16:55
Gordon85      gpgcheck: true16:55
Gordon85      gpgkey: https://apt.releases.hashicorp.com/gpg16:55
Gordon85what am I doing wrong? or what would be the alternative?, please16:55
holmanbGordon85: what's the terraform key for? I assume that is one of your problems17:25
holmanbah, nvm that's the key name for a repo17:28
holmanbGordon85: Per the docs, gpgcheck and gpgkey are not valid keys for the apt module: https://cloudinit.readthedocs.io/en/latest/topics/modules.html#apt-configure17:53
holmanbalso the url you listed is just a gpg keyfile, I think the apt repo will require a keyserver url and keyid/fingerprint - the examples here might be a good starting point for what you're trying to do: https://cloudinit.readthedocs.io/en/latest/topics/examples.html#additional-apt-configuration-and-repositories18:03
Gordon85Thank you holmanb I appreciate you taking the time to reply.18:24
Gordon85I did know the url was a gpg keyfile, but I thought cloud-init would just download it and use it (I didn't understand the whole inner workings behind gpgkey. I know that is the way it works for Yum, gpgkey can point ot a file or even a url)18:24
holmanbGordon85: alternative to a keyserver lookup, you can specify the key right in your config18:24
Gordon85thanks again, I'll check that part of the documentation (I didn't think to check the modules. The examples ... don't work that well for me, I did try keyserver, but ... I might have done something wrong because it didn't work)18:25
blackboxswlooks like one minor error on  our last focal integration test run now that the PPA build our daily recipe. https://github.com/canonical/cloud-init/pull/1420 for a minor integration test fix to clean up jenkins state18:51
ubottuPull 1420 in canonical/cloud-init "tests: verify_ordered_items fallback to re.escape if needed" [Open]18:51
blackboxswfalcojr: I can't recall if you said you were working on an upstart related issue today or not. In the interest of cleaning house I started pulling together a "drop upstart stuff" PR https://github.com/canonical/cloud-init/pull/142119:47
ubottuPull 1421 in canonical/cloud-init "upstart: drop vestigial support for upstart" [Open]19:47

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!