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

Ally_Hello, hope everyone is well. I don't suppose anyone can advise if there's a way to set the order of packages to be installed when specifying them in the YAML custom script? I want to install 'ansible' but I need to install 'oracle-epel-release-el7' first, putting it first still seems to get ignored, I imagine it does it alphabetically or similar?12:28
Ally_Or, should I just do it with a runcmd instead?12:29
acibaAlly: There is an undocumented (atm) way to do that using https://cloudinit.readthedocs.io/en/latest/topics/merging.html. Maybe falcojr could help you.12:42
Ally_Thanks aciba, much appreciated!13:21
falcojrAlly_: when you say order of packages to be installed, are you referring to using the 'packages' key in cloud-init userdata? E.g., packages: ['oracle-epel-release-el7', 'ansible']14:33
falcojror something else?14:33
Ally_Hi falcojr, yep15:19
falcojrAlly_: that behavior is distro-dependent. Which distro?15:20
Ally_We're using OEL 7.915:20
Ally_I've worked around it by doing it via runcmd, but I assumed there was a 'smarter' way by using the native package command15:22
falcojrhmmm, do you know if that gets identified as RHEL by cloud-init, or do you have some custom code for identifying that?15:22
Ally_It should identify as RHEL (it's a clone)15:22
Ally_Is there a quick way to determine how cloud-init sees it?15:23
blackboxswAlly_: I think cloud-init query distro15:24
falcojrblackboxsw: TIL! I would've said search the logs15:25
Ally_thanks blackboxsw15:25
blackboxswotherwise grep "Using distro class" /var/;log/cloud-init.log would cofirm15:25
blackboxswright15:25
Ally_# cloud-init query distro15:25
Ally_ERROR: Undefined instance-data key distro15:25
blackboxswahh OEL 7.9 ... older cloud-init based on version 19.3 or something right 15:26
Ally_# grep "Using distro class" //var/log/cloud-init.log15:26
Ally_2022-09-09 13:19:43,979 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.rhel.Distro'>15:26
blackboxswcool that worksthx15:26
Ally_Cloud-init v. 19.415:26
falcojrAlly_: so actually, it looks like regardless of distro it orders them in the way they were specified. But it does it with a single command. Are you looking for multiple, independent commands for installation?15:27
Ally_Umm, no, not really. To install 'ansible' package it needs the EPEL repo enabled, and that's an RPM install on OEL. So I specified the epel package first in the list of packages and 'ansible' second, but when it ran it tried to install the 'ansible' package first.15:29
Ally_https://pastebin.com/UVrFbJFj15:31
Ally_That's what I was trying to get to work15:31
Ally_I kinda assumed it was doing like a hoist in JS and running things alphabetically or something15:33
waldiAlly_: you are looking for yum_repos, which asks cloud-init to add repos15:34
waldicloud-init will of course not install packages one after one, but everything in one go15:34
Ally_Ah, ok, I think I see what you mean. So if I enable the EPEL using the yum_repos command I can skip the epel package part altogether.15:35
waldiyes15:35
Ally_I will test that now, thank you waldi (and everyone else!)15:35
blackboxswnote Ally_ you are specifying `ansible:` config in cloud-init but you are running cloud-init version 19.4 on OEL.... `ansible:`  support in cloud-init was only added after cloud-init version 22.2 so you'll probably have to use individual `runcmd:`declarations to perform that setup of ansible in your distro.16:12
blackboxswas I recall, python version on OEL is python2.7 right? which means that OEL systems won't be able to install and run anything beyond 19.4 unless they also happen to have python3 configured16:13
Ally_Ah, that's good to know, thank you!16:18
blackboxswnote we have a copr build repo https://copr.fedorainfracloud.org/coprs/g/cloud-init/el-testing/ that may help wih EL8-based images if you have them 16:24
blackboxswit contains cloud-init 22.316:24
cjp256blackboxsw/falcojr: any thoughts what may be happening here? https://pastebin.ubuntu.com/p/kDc5ZKRZVs/17:57
cjp256holman^17:57
cjp256(search for first hit of iid-datasource)17:58
blackboxswlooking18:01
cjp256get_data() is also called twice, init-local and init18:02
blackboxswstrange mid-init stage iid-datasource shows up18:03
cjp256this is on upgrade from 22.2 -> 22.3 in proposed18:05
cjp256thought maybe it was that recent cache change but I reverted it and didn't seem to change that18:05
blackboxswcjp256: so iid-datasource comes into play when cloud-init no longer sees "instance-id" in the cached metadata that was read18:07
blackboxswI'd be curious if something between init-local and init stage blew away self.metadata on the obj.pkl18:08
cjp256yeah, it should be there - i lost a debug log, i'll retry18:08
* blackboxsw takes a break from internal work and starts plugging away at Azure upgrade path on -proposed to see what's up there18:38
falcojr^ I would normally jump in to help, but I'm guessing it's a welcome break :P18:40
holmancjp256: what's puzzling me is that you said building from tag 22.3.1 didn't cause the same issue 18:40
holmanotherwise I'd guess that the self._reported_ready_marker_file addition not being unpickled as a likely cause18:41
cjp256I take that back, I think it may have been because I went from the proposed deb to the custom one?18:46
cjp256i retried that today and it did repro18:46
cjp256from a fresh 22.218:46
holman22.2->22.3.1 repro'd the issue?18:47
cjp256yeah the current image 22.2-0ubuntu1~22.04.318:47
holmangotcha18:47
cjp256i'll resume looking into it monday, have a good weekend! :D18:48
holmanyeah I'm pretty sure there's an issue on unpickle here, since _reported_ready_marker_file won't exist in 22.2 pickles,18:48
holmancjp256: You too!18:48
falcojrholman: we should figure out why the upgrade integration test didn't catch this. Do you need help digging into that?19:31
holman@falcojr: Saw your comment on the PR, I'm looking at that now. I should be more familiar with this and I've never touched it, so I'll reach out if I need help. 19:32
holman@falcojr: looks like test_upgrade in SRU testing used an image_id: Canonical:0001-com-ubuntu-server-jammy-daily:22_04-daily-lts19:47
holmanDaily images would have compatible pickles I think.19:47
falcojrholman: it's not the daily ppa. It's the daily cloud image. I wouldn't expect it to launch with that property, so it shouldn't be in the pickle at upgrade19:50
falcojri.e., I would expect Canonical:0001-com-ubuntu-server-jammy-daily:22_04-daily-lts to be providing 22.2, then the upgrade test upgrades to 22.3 proposed19:51
holmanfalcojr: I see, thanks.19:57
holmantangentially related, I see that the ubuntu cloud-image locator website isn't aware of the existence of Jammy images.19:58
* holman goes back to digging into the test19:59
holmans/Jammy images/Jammy images on Azure/g19:59
CorvetteZR1hello.  how do i edit an existing cloud-init config?21:26
CorvetteZR1i set up a mount with noexec option.  i removed it manually from fstab and remount; but when i reboot the server, i see noexec in fstab again.  how can i modify it in cloudinit, so when it overwrites fstab, it no longer applies noexec ?21:27
CorvetteZR1without reprovisioning whole server i mean21:27
holman@falcojr - not sure if you're still around, but I did a brain-dump of my working theory in that PR.21:59
falcojrholman: cool. I'll take a look (maybe Monday)22:00
holman@falcojr sweet, no rush22:00
holmanCorvetteZR1: What's your config look like? cc_mounts runs once per instance, so running every boot is not expected. More information in general about your setup would help a lot :)22:02
blackboxswholman: you are totally right on cjp256's Azure upgrade bug. it is unpickling problem across upgrade given that the obj.pkl doesn't have the _. the following patch fixes it https://paste.ubuntu.com/p/4yybCvHgvp/23:31
blackboxswI'll put up a PR and set you both as reviewers23:32
blackboxswthis will block SRU23:32

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