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

Guest93It looks like the DataSourceEC2 manages block device mappings and it's the only datasource that does so. Is your custom datasource "done" when you have it being detected and setting up networking basically?01:53
johnjayehrm. if i specify simply password=foo in the seed file does that apply to the root account by default, or some other account?15:58
johnjayei thought the acc name on debian clouds was 'debian' but debian/foo isn't working15:59
minimaljohnjaye: which "seed file"? password=foo is not valid in the user-data YAML file is that is what you are referring to16:11
johnjayewell ok. but that's what the man page for cloud-localds said to write17:20
johnjayeso i assumed it was a meaningful example17:20
minimaljohnjaye: you mean the Examples section of that manpage? it mentions "password: <whatever>", not "password=<whatever>"17:23
minimalas the first form *is* valid YAML17:23
johnjayei have it as password: blah17:24
minimaljohnjaye: ok, in your earlier post you said "password=foo" so that what what I commented on17:25
johnjayeso unless yaml has some sneaky way of tricking you with non-printable characters i got no idea17:25
minimals/what what/was what.17:25
johnjayei guess the first line has to be like #cloud-config or something 17:26
johnjayethe manual said that i thought17:26
minimalbest to look at the cloud-init docs for examples17:28
minimaljohnjaye: when you say "debian/foo" isn't working do you for logging onto the VM's console? or via SSH? typically in "cloud" images SSH access is only enable via SSH key and not via password17:33
johnjayethe vm console17:35
johnjayeoh i see. so i need to forward ssh to this qemu instance then17:35
minimaljohnjaye: ? you just said you are using the console so then SSH is not relevant17:35
johnjayeyeah. you made it sound like direct login wouldn't work17:36
johnjayeso i may need to add something for that17:36
minimalso assuming that the VM image you are using has defined "debian" as the default user for cloud-init (you would have to either check the image yourself or ask whomever created the image to determine this) and that you created a seed ISO with user-data containing "#cloud-config\npassword: foo\n" then yes you should be able to login as debian/foo17:37
minimalwhere the "\n" above represent actual line breaks17:42
johnjayehmm that didn't work either. i'll read the manual and play 20 questions with the syntax later17:44
minimaljohnjaye: which exact debian image are you using?17:46
johnjayeones from the wiki, under 'cloud'. they provide several. named like debian-12-generic-i386.{raw,qcow2,vmdk}17:47
minimaljohnjaye: which *exact* one?17:47
johnjayeidk what you mean. the copy i have is debian-11-generic-arm64.qcow217:47
johnjayeis it customary to provide daily cloud image snapshots? i thought there were dozens of them by date17:48
minimaljohnjaye: that's that Debian decision17:51
minimals/that /a /17:52
minimaljohnjayne: right, add the following line to your user-data file: "lock_passwd: false", rebuild the seed ISO and try again18:06
johnjayeby the way, can cloud-init do stuff like setup sudo or user groups and such things?18:06
minimalthat Debian image does use "debian" as the default username but it also locked that user for password access18:06
falcojrjohnjaye: yes, see https://cloudinit.readthedocs.io/en/latest/topics/modules.html#users-and-groups18:06
johnjayeis False interchangeable with false18:10
johnjayeeither way i capitalized it18:10
minimalI believe YAML treats "false" and "False" as the same18:10
falcojractually...I don't think so. In yaml I think it's only false18:10
johnjayefalcojr: ok. i was wondering if it would be that unusual to try using cloud-init to change settings on a regular system.18:11
minimalfalcojr: "yamllint" could be used to be sure...18:11
johnjayeminimal: when you say you're a cloud dev, does that mean you work on cloud-init itself or that you use it18:12
minimalboth18:13
johnjayeoh. i see18:13
johnjayethis whole cloud world seems like it has its own culture and idioms18:13
johnjayelike provisioning. the disk being called /dev/vda18:13
johnjayeor ssh being the 'obvious' default18:13
minimaljohnjaye: /dev/vda is a virtio-blk devices, that's nothing specific to cloud-init18:14
minimalwhereas /dev/sda could be a SCSI device, or a virtio-scsi device, or a SATA device18:14
minimalthat's a Linux thing, not a cloud-init thing18:14
johnjayeah my bad. ok it says the root account is locked18:14
johnjayemaybe i should have said false not False...18:15
minimaljohnjaye: root? you're supposed to be testing the "debian" account18:15
johnjayeright. i mean, that's what the startup message says18:15
johnjayeCannot open access to console, the root account is locked.18:15
minimalhave you tried to login as debian/foo ?18:16
johnjayehrm. i think it's just taking a lot longer. i'm on my pi now and it has an sdcard18:16
johnjayeso qemu takes like 4x as long to boot up.18:16
johnjayemaybe if i plug in a usb stick it would be faster18:17
johnjayelol. what is a randomart image for an ssh key.18:17
johnjayeit shows several18:17
johnjayeok debian/foo did work and i logged in18:19
minimaljohnjaye: have you not seen this output when you booted this VM image previously? It should appear the 1st time you boot a cloud-init based VM18:19
johnjaye\o18:19
johnjayeminimal: it all goes by so fast you can't read it18:19
minimallook at /var/log/cloud-init-output.log18:19
johnjayenow i do believe you're a cloud dev. i would never have randomly guessed that filename18:20
johnjayethat only shows the ssh art and something about ipv618:21
johnjayecloud-init.log doesn't either afaik. so maybe those were dmesg18:22
johnjayeah at least sudo is configured. that's nice18:23
minimalwhich output were you looking for? I thought you wanted to see the ssh art again18:23
johnjayeheh. no that message about root account being locked. i don't see it in those logs you said18:24
johnjayeor in dmesg18:24
johnjayebut hey at least it lets me login. that's amazing18:25
minimalso for that debian VM image the root account is locked, it is configured so that cloud-init will create a "debian" user by default but lock the account's password, so you need to set user-data appropriate for what you want.18:25
johnjayeis that common in cloud stuff18:26
minimaljohnjaye: that would be likely in "journalctl" output as usual, nothing to do with cloud-init18:26
johnjayelike when i said password: foo how did that automatically apply to 'debian' and not say 'root'. or 'admin'. or something else18:26
minimaljohnjaye: it's up to whoever packaged the disk image to decide, typically for images on cloud providers password access via SSH is disabled and SSH public keys have to be provided in user-data (along with any users/groups you want to add)18:27
johnjayeyeah but i meant the yaml file18:27
johnjayehow does it decide what to apply password: foo to. just the first user account?18:28
minimaljohnjaye: "password: " applies to the default user defined in /etc/cloud/cloud.cfg ("default_user:", "name:") set by the Debian people18:28
johnjayewhat if there isn't one18:28
minimalthe same way that they alos have "lock_passwd: True" in there18:28
johnjayethen there's just no login as root or anything else18:28
minimaljohnjaye: there's always a default user, that's why it is called the default user...18:29
johnjayei thought you can create unix systems with no users. just root18:29
johnjayelike in the past when i install debian sometimes it does that18:29
johnjayeno users, i have to manually create them18:30
minimalwell my previous statement is not 100%, when you create additional users in user-data you can decide whether or not the default user is also created18:31
johnjayeoh ok18:31
johnjayeand when you're doing this sort of thing is it for a person usually18:32
minimalbut the idea is "out of the box" if you don't specify users then you get the default user18:32
johnjayeas in like an individual customer. or is it more like you need to automate setting up 1000 debian instances for a CI thing18:32
minimalit is whatever you want to do - for each Vm you create you provide user-data (and other settings) for that VM18:33
johnjayeok. i was reading about google cloud and you basically write a command like 'give me a ubuntu 18 instance with username password foo/bar' and it instantly copies all the relevant data into it18:33
johnjayeso i assume all these cloud providers either use cloud-init or else have something themselves18:34
minimaljohnjaye: yes the vast majority of cloud providers can or do use cloud-init (I think GCE had some alternative system in the past, not sure if it is still used)18:37
minimalso when you provision a Linux instance/VM on AWS, GCE, Azure, etc you give it user-data for that VM18:37
meenafalcojr: I lost a day to migraine19:44
falcojr:( Migraines suck19:45
meenaI think it might have been just (lack of) caffeine induced, but it took almost a full day, and did not respond to ibuprofen. I've also started mapping them, to see if there's a pattern, cuz I feel that since i went thru Covid it's become a monthly recurrence20:03
meenafalcojr: will need fresher head to go fixing all those test failures when moving the ifconfig invocation into __init__20:40
meenabut, I think that will also make it a good opportunity to extend tests to fit these new code paths20:41
meenafalcojr: i really need to start looking into TypedDict… it seems like it would solve a lot of problems… a lot of problems i have created for myself.21:03
meenaoh, i … went too far…21:06
meena    def is_physical(self) -> bool:21:06
meena        # OpenBSD makes this very easy:21:06
meena        return "egress" in self.groups21:06
meena        return self.groups == [] and self.media and "Ethernet" in self.media21:06
meenaThis isn't erlang…21:06
meenafalcojr: absolutely no idea how to do this: https://github.com/canonical/cloud-init/pull/1779#discussion_r999877423 (without ruining typing)21:11
-ubottu:#cloud-init- Pull 1779 in canonical/cloud-init "Net: add BSD ifconfig(8) parser" [Open]21:11
falcojrmeena: sorry, was a suggestion. If it works better for you to keep it as-is, that's fine21:46
falcojralso, IIRC, TypedDict isn't supported on 3.6 which is still cloud-init's minimum version21:47
meenafalcojr: if you initialize dev = None at the top, it becomes Optional[Ifstate] and a lot more complicated21:47
meenaaye…21:47
holmanTypeDict is in the codebase already21:48
holmanI added it21:48
holmanI think it's available, but limited in what syntax you can use iirc21:48
falcojrholman: you added a version gate I think...so I don't think I want to keep doing that everywhere21:48
meenaand now, to break some tests21:49
meenaand then goto bed.21:49
holmanoh you're right21:49
meenaokay, so, basically, now i need to mock every creation of a BSD mock distro, with a test appropriate output of subp([ifconfig -a])22:03
meenayeah, i don't think I'm getting any fresher ideas22:11
meenaGood night folks o/~22:11
meenaweird… make check fails on my laptop, but not on Travis?22:23

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