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

falcojrchiluk: You were asking about rerunning networking. Not sure if this is what you want, but there's a net-convert tool to test cloud-init's rendering of network config00:45
falcojrhttps://cloudinit.readthedocs.io/en/latest/topics/cli.html#devel00:45
falcojryou can feed it your v1 or v2 network config and have it spit out the distro-specific networking config that you're working with00:46
falcojrand to rerun cloud-init without booting, you can do something like00:47
falcojrcloud-init clean --logs; cloud-init init --local; cloud-init init; cloud-init modules --mode=config; cloud-init modules --mode=final;00:47
falcojrbut as somebody mentioned, this isn't a great idea unless it's purely for development/debugging on a throwaway instance00:48
=== gschanuel6 is now known as gschanuel
=== gschanuel9 is now known as gschanuel
blackboxswholmanb: falcojr I saw promoting the `cloud-init devel schema` to a top-level subcommand landed `cloud-init schema`. Did folks have a discussion about whether there would be a separate PR that would still respond to `cloud-init devel schema` with a deprecation or wrapper to the real entry point? I ask because I know there are external blogs askubuntu questions that make reference to the old subcommand location20:37
Guest44454Hi all, can I get some help on my yaml here for cloud-init?21:17
Guest44454Here is my yaml:21:18
Guest44454#cloud-config21:18
Guest44454autoinstall:21:18
Guest44454  version: 121:18
Guest44454  identity:21:18
Guest44454    hostname: ubuntu-server21:18
Guest44454    password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"21:18
Guest44454    username: ubuntu21:18
Guest44454  interactive-sections:21:18
Guest44454    - storage21:18
Guest44454  users:21:18
Guest44454      - name: guy121:18
Guest44454        groups: sudo21:18
Guest44454        sudo:  ALL=(ALL) NOPASSWD:ALL21:18
Guest44454        primary_group: guy121:18
Guest44454        lock_passwd: false21:18
Guest44454        passwd: "$6$mUvHxAq8YK2ZO$urxKPXcW2RRjHyRiQ3P34B.XOouwgsx9Qu4EZnBfvVFvn74HenKJyrCvfb6bJRd2wf5Jk6Sa/lvokB5mGfOo2."21:18
Guest44454This does not work, anyone can help me?21:18
arinovlogs?21:19
Guest44454The part that does not work is the users: Everything else works (The Ubuntu server installs fine)21:19
Guest44454Where can I find the logs?21:19
blackboxswGuest44454: on the installed system you can run `sudo cloud-init query userdata; sudo cloud-init devel schema --system --annotate` as well as 'egrep warning|traceback /var/log/cloud-init.log'21:20
Guest44454Ok, let me check ..21:20
blackboxswGuest44454: also generally the installer yaml provides a contstruct where anything you are trying to pass to cloud-init directly needs to be under a "user-data:" key21:23
Guest44454This yaml is my user-data file, sorry I forgot to mention21:23
falcojrblackboxsw: "a separate PR that would still respond to `cloud-init devel schema` with a deprecation or wrapper to the real entry point?" deprecation was in the PR but I preferred we remove it entirely21:24
minimalGuest44454: where is group "guy1" created?21:24
falcojraccording to our docs, Collection of development tools under active development. These tools will likely be promoted to top-level subcommands when stable.21:25
falcojrDo NOT rely on the output of these commands as they can and will change.21:25
minimalnormally a (primary) group is created with the same name as the user automatically21:25
blackboxswso I'm guessing your yaml needs to be something like this https://paste.opendev.org/show/bOKYUL6wXcS0TnIFDkJ5/21:26
blackboxswGuest44454: ^ 21:26
minimalGuest44454: ignore me, I misread the YAML lol21:26
blackboxswfalcojr: ok; on not supporting the 'devel schema' entry point. it should generally be discoverable given it'll be present as a top-level cmd. 21:27
Guest44454blackboxsw: Results to logs:21:29
blackboxswminimal: yeah, with the fact that autoinstall supported schema is from the Ubuntu live-server installer is effectively a super-set of cloud-config directive under a sub-key "user-data:". Both teams have an item on our next 6 month roadmap to make sure the combined schema validation is done at install time to avoid concerns like Guest44454 is raising here.21:29
Guest44454-bash: egrep warning|traceback /var/log/cloud-init.log: No such file or directory21:31
blackboxswGuest44454: that tells us cloud-init hasn't run I think. `cloud-init status --long`21:31
blackboxswor rather `sudo cloud-init status --long` in your environment 21:34
Guest44454blackboxsw: I installed my custom iso with this yaml, and only had to interact with the storage setup (as per yaml). After reboot, I could login with the user ubuntu and password ubuntu21:34
Guest44454so that tells me it did run, but did not add my additional user?21:34
Guest44454status: done21:37
Guest44454time: Wed, 27 Apr 2022 21:27:56 +000021:37
Guest44454detail:21:37
Guest44454DataSourceNone21:37
blackboxswGuest44454: please maybe take us through the steps you followed to create the custom iso , as the "users:" yaml directives you provided is completely ignored and something else is providing cloud-init with your default ubuntu user. If the "users:" directive was being seen by cloud-init it cloud-init would not have created the default ubuntu user on the system because it expects to minimally see `users:\n- default\n- name: 21:39
blackboxswyour_additional_user....\n`21:39
Guest44454This is the result from the sudo cloud-init query*** command:21:39
Guest44454#cloud-config21:39
Guest44454growpart:21:39
Guest44454  mode: 'off'21:39
Guest44454locale: en_US.UTF-821:39
Guest44454preserve_hostname: true21:39
Guest44454resize_rootfs: false21:39
Guest44454users:21:39
Guest44454- gecos: ubuntu21:39
Guest44454  groups: !!set21:39
Guest44454    adm: null21:39
Guest44454    cdrom: null21:39
Guest44454    dip: null21:39
Guest44454    lxd: null21:39
Guest44454    plugdev: null21:39
blackboxswok datasourceNone looking good.21:39
Guest44454    sudo: null21:39
Guest44454  lock_passwd: false21:39
Guest44454  name: ubuntu21:39
Guest44454  passwd: $6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P021:39
blackboxswGuest44454: please use https://paste.opendev.org or paste.ubuntu.com to aid in readability for us21:39
Guest44454Ok,21:40
blackboxswok so the users definition is coming from somewhere else. From the live server installer POV. I expect this is under /etc/cloud/cloud.cfg.d/99-installer.cfg21:40
Guest44454Does this help:21:41
Guest44454#cloud-config21:41
Guest44454growpart:21:41
Guest44454  mode: 'off'21:41
Guest44454locale: en_US.UTF-821:41
Guest44454preserve_hostname: true21:41
Guest44454resize_rootfs: false21:41
Guest44454users:21:41
Guest44454- gecos: ubuntu21:41
Guest44454  groups: !!set21:41
Guest44454    adm: null21:41
Guest44454    cdrom: null21:41
Guest44454    dip: null21:41
Guest44454    lxd: null21:41
Guest44454    plugdev: null21:41
Guest44454    sudo: null21:41
Guest44454  lock_passwd: false21:41
Guest44454  name: ubuntu21:41
Guest44454  passwd: $6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P021:41
blackboxswI mean the stream of lines that you copy into IRC makes it a bit tough and noisy for folks trying to follow the conversation. So remote paste links makes it easier to re-read/understand the conversation21:42
Guest44454My custom iso is from this site / gentleman: https://www.pugetsystems.com/labs/hpc/How-To-Make-Ubuntu-Autoinstall-ISO-with-Cloud-init-2213/21:42
Guest44454Thanks blackboxsw, I can paste in remote link, but how do I share it :)21:43
blackboxswgreat. you can go to either https://paste.opendev.org/ or paste.ubuntu.com and cut and paste your text there and hit submit. then you can paste just the link here and we can see that formatted text easily21:43
blackboxswGuest44454: but all good for the moment.21:44
blackboxswGuest44454: so note from what you saw in `sudo cloud-init query userdata` shows us that it didn't honor your `users:` autoinstall directives21:45
blackboxswGuest44454: I believe this is because you need to have any specific cloud-init overrides under a "user-data:" key instead of just under "autoinstall:"21:46
Guest44454Ok, can I say at this point, I have no idea what that means? Yes, I am very new to yaml & cloud-init21:48
Guest44454Do I add a user-data: key before users:21:48
blackboxswGuest44454: no worries. Note as well that your "identity:" section in your original paste defines that ubuntu default user/password. and it seems like you are trying to pass "users:" directives into cloud-init proper. In this installer case, you'd want to pass "users:" into cloud-init  and the way to do that is to add a "user-data:" key above "users:". Which I represented in this paste 21:50
blackboxswhttps://paste.opendev.org/show/bOKYUL6wXcS0TnIFDkJ5/21:50
Guest44454:)  Ok, so I guessed that correctly21:51
Guest44454Thanks,21:51
blackboxswGuest44454: also I'm not truly certain how the live-server autoinstall yaml interacts with cloud-init when you provide both `identity:` and `user-data: users:` as the docs show that providing user-data makes identity: optional. So you may end up needing something like this (with a `-default`) added on line 12 https://paste.opendev.org/show/bErdasUTKXCOApN3ftF3/21:54
Guest44454Now, I will try this and see if it works, behind that, i need to add respositories, update the system, install additional software from my repositories and configure network..... fun21:54
Guest44454@black21:54
blackboxswgood luck and please do provide feedback on how that worked for you or bumps you hit21:54
blackboxswwe are actively trying to improve the experience here as it is confusing21:55
Guest44454blackboxsw yes, I believe the - default string add the user to the existing admin user21:55
blackboxswGuest44454: schema docs for the autoinstaller syntax in case you haven't seen them  https://ubuntu.com/server/docs/install/autoinstall-reference21:55
Guest44454Thanks, will do....21:55
blackboxswgreat21:55
Guest44454Maybe I should create a username so i can come back and not get lost in the sea21:56
blackboxsw /nick somename_you_want will do that if you like21:57
=== Guest44454 is now known as ice10001
ice10001Here goes. Startin up my VM with my custom iso22:01
blackboxswwelcome ice10001 22:01
ice10001:)  I am Guest 4445422:02
ice10001Lol, now I cannot log in via any account, the guy1 or the ubuntu22:07
ice10001Apologies, I can now log in with guy122:13
ice10001But not with ubuntu22:13
ice10001But that is progress!!22:13
blackboxswnice, ice10001  yeah I'm presuming the identify: and user-data: users are colliding somehow in what gets passed into cloud-init22:24
ice10001I have removed the - default parameter, lets see..22:25
ice10001Not that I know it will work, but am literally trying to see what could be causing issue22:25
blackboxswice10001: you could specifically omit the `identity:` section entirely and provide user-data:\n  hostname : ubuntu-server\n  password: ""$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"\n  22:33
blackboxswand leave the `- default` in  your `users:` list22:33
blackboxswthen you won't have to collisions with how the live-server autoinstall is handling the ubuntu user setup.22:33
blackboxswand cloud-init specifically will do that work to setup the  -default (ubuntu) user and hostname directly instead of relying on the autoinstaller layer (subiquity) to do that work ahead of time22:34
ice10001Let me write that so I understand...22:34
ice10001Oh wait... so no identity, just straight to user-data:22:35
blackboxswinstead of https://paste.opendev.org/show/bOKYUL6wXcS0TnIFDkJ5/ I'm wildly guessing something like this 2nd paste https://paste.opendev.org/show/bIO6TFx6ksSGVRuhVRaP/22:36
blackboxswyeah ice10001 like the above22:36
blackboxswok I have to head out for the day. Hope that works for you or something close to that22:37
ice10001Thanks you so much!!22:37
NewbieI am new here and new to cloud-init and would appreciate some guidance22:37
Newbiehas anyone tried using compressed gzip encoded userdata in alicloud?22:37
NewbieI have been failing miserably with it to while decoding22:38
=== Guest44454 is now known as ice10001

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