/srv/irclogs.ubuntu.com/2021/02/26/#cloud-init.txt

LoebHow exactly does cloud-init determine where the cloud config file is read from?03:42
blackboxswLoeb: it depends on the datasource detected where the cloud-config sources are. `cloud-init status --long` will show you what your datasource is and may show you where the seed files for user-data is read for that datasource. `sudo cloud-init query userdata` will tell you what userdata values were read.03:45
blackboxsw... some datasources support multiple locations for cloud-config userdata.03:45
blackboxswyour datasource docs might describe those locations https://cloudinit.readthedocs.io/en/latest/topics/datasources.html03:46
Loebok so, in this case I'm PXE booting and appending what I believe to be the location info in the pxelinux config. "ds=nocloud-net;s=<URL>" I believe is what is supposed to determine the location03:48
Loebbut digging through the logs it only appears to look for the "meta-data" file there, which (I think) isn't relevant in my case?03:48
LoebThat's the only thing I see it failing to read, anyhow. I also saw it didn't see a leading "#cloud-config" line at the URL pointing towards the ISO.03:49
Loeband what I'm seeing for the nocloud config is WAY different from the config file/examples I was seeing03:53
LoebI've been trying to set up a bare metal unattended install. From what I've seen it appears that the way to do this on ubuntu nowadays is cloud-init???03:54
LoebI've seen documentation for anaconda, debian-installer, and now cloud-init. I could be wrong on this but the docs are a bit of a mess.03:55
LoebThe docs for the ubuntu unattended install, that is.03:55
Loebblackboxsw, for funsies I named my config yaml file "meta-data" and touched "user-data" and "vendor-data" to see what the installer did... and I don't see any explicit errors in /var/log/cloud-init.log ? Not sure what' it's doing at this point, it drops me into the interactive ubuntu gui installer each time.04:32
LoebI do see it grabbing the files from the network and reading them in04:33
LoebI did have the right config, but the info needed to reside in "user-data" not "meta-data". I still find the documentation for this a bit lacking, along with cloud-init not spitting out particularly useful error messages when it say, reads an empty config file like this and defaults to something else.09:13
LoebRegardless, it does appear to be functional now. I had a big 'ol fight with subiquity afterwords. It's problematic.09:14
krysennHi,13:49
krysennI'm new with cloud-init, and i'm trying to configure an ssh key on my instance through meta-data with a NoCloud datasource, but it not works.13:49
krysennAnybody can help me ? Thanks :)13:49
meenauh… i was gonna say they're too impatient for quitting before getting an answer, but it's been over an hour15:08
Odd_BlokeMaybe they fixed it. :p15:14
testcla234is possible to achieve this :15:19
testcla234curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -15:19
testcla234with <sources:?15:19
testcla234* with <sources:>15:19
Odd_Bloketestcla234: I don't believe so, no, unfortunately.  I think your best bet is probably to fetch the key and include it as `key` in the appropriate `sources` section.  Looks like the keys get cycled every 2/3 years, so that's not totally impossible to manage.  Not ideal, certainly!15:35
testcla234on ubuntu the 2 keys need to be store in here15:36
testcla234ls -al /usr/share/keyrings/cloud.google.gpg15:36
testcla234-rw-r--r-- 1 root root 2054 Feb 26 15:16 /usr/share/keyrings/cloud.google.gpg15:36
testcla234otherwise failed on apt update15:36
testcla234I just avoid using <source:> and use runcmd15:37
Odd_BlokeThat's not the correct path for user-installed keys, /etc/apt/trusted.gpg.d/ is preferred.15:37
Odd_Bloke`runcmd` will work fine, but the key won't be in place in time for cloud-init's apt installation, I believe.15:38
Odd_BlokeIf you aren't using that, not a problem, ofc.15:38
testcla234unfortunately that is the path using by google - https://cloud.google.com/sdk/docs/quickstart#installing_the_latest_version15:40
testcla234on `runcmd` I just use :15:41
testcla234 echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg  add - && apt-get update -y && apt-get install15:41
testcla234google-cloud-sdk -y15:41
testcla234testing now15:41
Odd_BlokeYeah, I expect that will work.15:41
Odd_BlokeJust that's not the preferred path for keyrings that aren't installed by system packages.15:42
Odd_Bloke(And I don't know if there might be other consequences of putting it there.)15:42
testcla234is not possible to use LVM on disk_setup , right?15:47
Odd_Bloketestcla234: Correct.16:05
testcla234strange this16:08
testcla234[   35.315499] cloud-init[866]: 2021-02-26 15:54:19,903 - __init__.py[WARNING]: Unable to add group member 'user1' to group 'docker'; user does not exist.16:08
testcla234grep -i user1 /etc/passwd16:08
testcla234user1:x:1000:1001:Ubuntu:/home/user1:/bin/bash16:08
testcla234ignore this on azure the user1 seems to create after cloud-init16:10
Odd_Blokecloud-init creates groups before it creates users (so that user definitions can refer to those groups); doing, roughly, `groups: [docker]` and `users: [{..., "groups": ["docker"]}, ...]` should work.16:10
Odd_BlokeBut yeah, if that's not created by cloud-init then bets are off. :)16:11
=== ijohnson is now known as ijohnson|lunch
=== ijohnson|lunch is now known as ijohnson

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