falcojr | chiluk: 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 config | 00:45 |
---|---|---|
falcojr | https://cloudinit.readthedocs.io/en/latest/topics/cli.html#devel | 00:45 |
falcojr | you can feed it your v1 or v2 network config and have it spit out the distro-specific networking config that you're working with | 00:46 |
falcojr | and to rerun cloud-init without booting, you can do something like | 00:47 |
falcojr | cloud-init clean --logs; cloud-init init --local; cloud-init init; cloud-init modules --mode=config; cloud-init modules --mode=final; | 00:47 |
falcojr | but as somebody mentioned, this isn't a great idea unless it's purely for development/debugging on a throwaway instance | 00:48 |
=== gschanuel6 is now known as gschanuel | ||
=== gschanuel9 is now known as gschanuel | ||
blackboxsw | holmanb: 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 location | 20:37 |
Guest44454 | Hi all, can I get some help on my yaml here for cloud-init? | 21:17 |
Guest44454 | Here is my yaml: | 21:18 |
Guest44454 | #cloud-config | 21:18 |
Guest44454 | autoinstall: | 21:18 |
Guest44454 | version: 1 | 21:18 |
Guest44454 | identity: | 21:18 |
Guest44454 | hostname: ubuntu-server | 21:18 |
Guest44454 | password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0" | 21:18 |
Guest44454 | username: ubuntu | 21:18 |
Guest44454 | interactive-sections: | 21:18 |
Guest44454 | - storage | 21:18 |
Guest44454 | users: | 21:18 |
Guest44454 | - name: guy1 | 21:18 |
Guest44454 | groups: sudo | 21:18 |
Guest44454 | sudo: ALL=(ALL) NOPASSWD:ALL | 21:18 |
Guest44454 | primary_group: guy1 | 21:18 |
Guest44454 | lock_passwd: false | 21:18 |
Guest44454 | passwd: "$6$mUvHxAq8YK2ZO$urxKPXcW2RRjHyRiQ3P34B.XOouwgsx9Qu4EZnBfvVFvn74HenKJyrCvfb6bJRd2wf5Jk6Sa/lvokB5mGfOo2." | 21:18 |
Guest44454 | This does not work, anyone can help me? | 21:18 |
arinov | logs? | 21:19 |
Guest44454 | The part that does not work is the users: Everything else works (The Ubuntu server installs fine) | 21:19 |
Guest44454 | Where can I find the logs? | 21:19 |
blackboxsw | Guest44454: 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 |
Guest44454 | Ok, let me check .. | 21:20 |
blackboxsw | Guest44454: 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:" key | 21:23 |
Guest44454 | This yaml is my user-data file, sorry I forgot to mention | 21:23 |
falcojr | blackboxsw: "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 entirely | 21:24 |
minimal | Guest44454: where is group "guy1" created? | 21:24 |
falcojr | according to our docs, Collection of development tools under active development. These tools will likely be promoted to top-level subcommands when stable. | 21:25 |
falcojr | Do NOT rely on the output of these commands as they can and will change. | 21:25 |
minimal | normally a (primary) group is created with the same name as the user automatically | 21:25 |
blackboxsw | so I'm guessing your yaml needs to be something like this https://paste.opendev.org/show/bOKYUL6wXcS0TnIFDkJ5/ | 21:26 |
blackboxsw | Guest44454: ^ | 21:26 |
minimal | Guest44454: ignore me, I misread the YAML lol | 21:26 |
blackboxsw | falcojr: 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 |
Guest44454 | blackboxsw: Results to logs: | 21:29 |
blackboxsw | minimal: 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 directory | 21:31 |
blackboxsw | Guest44454: that tells us cloud-init hasn't run I think. `cloud-init status --long` | 21:31 |
blackboxsw | or rather `sudo cloud-init status --long` in your environment | 21:34 |
Guest44454 | blackboxsw: 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 ubuntu | 21:34 |
Guest44454 | so that tells me it did run, but did not add my additional user? | 21:34 |
Guest44454 | status: done | 21:37 |
Guest44454 | time: Wed, 27 Apr 2022 21:27:56 +0000 | 21:37 |
Guest44454 | detail: | 21:37 |
Guest44454 | DataSourceNone | 21:37 |
blackboxsw | Guest44454: 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 |
blackboxsw | your_additional_user....\n` | 21:39 |
Guest44454 | This is the result from the sudo cloud-init query*** command: | 21:39 |
Guest44454 | #cloud-config | 21:39 |
Guest44454 | growpart: | 21:39 |
Guest44454 | mode: 'off' | 21:39 |
Guest44454 | locale: en_US.UTF-8 | 21:39 |
Guest44454 | preserve_hostname: true | 21:39 |
Guest44454 | resize_rootfs: false | 21:39 |
Guest44454 | users: | 21:39 |
Guest44454 | - gecos: ubuntu | 21:39 |
Guest44454 | groups: !!set | 21:39 |
Guest44454 | adm: null | 21:39 |
Guest44454 | cdrom: null | 21:39 |
Guest44454 | dip: null | 21:39 |
Guest44454 | lxd: null | 21:39 |
Guest44454 | plugdev: null | 21:39 |
blackboxsw | ok datasourceNone looking good. | 21:39 |
Guest44454 | sudo: null | 21:39 |
Guest44454 | lock_passwd: false | 21:39 |
Guest44454 | name: ubuntu | 21:39 |
Guest44454 | passwd: $6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0 | 21:39 |
blackboxsw | Guest44454: please use https://paste.opendev.org or paste.ubuntu.com to aid in readability for us | 21:39 |
Guest44454 | Ok, | 21:40 |
blackboxsw | ok 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.cfg | 21:40 |
Guest44454 | Does this help: | 21:41 |
Guest44454 | #cloud-config | 21:41 |
Guest44454 | growpart: | 21:41 |
Guest44454 | mode: 'off' | 21:41 |
Guest44454 | locale: en_US.UTF-8 | 21:41 |
Guest44454 | preserve_hostname: true | 21:41 |
Guest44454 | resize_rootfs: false | 21:41 |
Guest44454 | users: | 21:41 |
Guest44454 | - gecos: ubuntu | 21:41 |
Guest44454 | groups: !!set | 21:41 |
Guest44454 | adm: null | 21:41 |
Guest44454 | cdrom: null | 21:41 |
Guest44454 | dip: null | 21:41 |
Guest44454 | lxd: null | 21:41 |
Guest44454 | plugdev: null | 21:41 |
Guest44454 | sudo: null | 21:41 |
Guest44454 | lock_passwd: false | 21:41 |
Guest44454 | name: ubuntu | 21:41 |
Guest44454 | passwd: $6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0 | 21:41 |
blackboxsw | I 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 conversation | 21:42 |
Guest44454 | My 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 |
Guest44454 | Thanks blackboxsw, I can paste in remote link, but how do I share it :) | 21:43 |
blackboxsw | great. 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 easily | 21:43 |
blackboxsw | Guest44454: but all good for the moment. | 21:44 |
blackboxsw | Guest44454: so note from what you saw in `sudo cloud-init query userdata` shows us that it didn't honor your `users:` autoinstall directives | 21:45 |
blackboxsw | Guest44454: 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 |
Guest44454 | Ok, can I say at this point, I have no idea what that means? Yes, I am very new to yaml & cloud-init | 21:48 |
Guest44454 | Do I add a user-data: key before users: | 21:48 |
blackboxsw | Guest44454: 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 |
blackboxsw | https://paste.opendev.org/show/bOKYUL6wXcS0TnIFDkJ5/ | 21:50 |
Guest44454 | :) Ok, so I guessed that correctly | 21:51 |
Guest44454 | Thanks, | 21:51 |
blackboxsw | Guest44454: 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 |
Guest44454 | Now, 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..... fun | 21:54 |
Guest44454 | @black | 21:54 |
blackboxsw | good luck and please do provide feedback on how that worked for you or bumps you hit | 21:54 |
blackboxsw | we are actively trying to improve the experience here as it is confusing | 21:55 |
Guest44454 | blackboxsw yes, I believe the - default string add the user to the existing admin user | 21:55 |
blackboxsw | Guest44454: schema docs for the autoinstaller syntax in case you haven't seen them https://ubuntu.com/server/docs/install/autoinstall-reference | 21:55 |
Guest44454 | Thanks, will do.... | 21:55 |
blackboxsw | great | 21:55 |
Guest44454 | Maybe I should create a username so i can come back and not get lost in the sea | 21:56 |
blackboxsw | /nick somename_you_want will do that if you like | 21:57 |
=== Guest44454 is now known as ice10001 | ||
ice10001 | Here goes. Startin up my VM with my custom iso | 22:01 |
blackboxsw | welcome ice10001 | 22:01 |
ice10001 | :) I am Guest 44454 | 22:02 |
ice10001 | Lol, now I cannot log in via any account, the guy1 or the ubuntu | 22:07 |
ice10001 | Apologies, I can now log in with guy1 | 22:13 |
ice10001 | But not with ubuntu | 22:13 |
ice10001 | But that is progress!! | 22:13 |
blackboxsw | nice, ice10001 yeah I'm presuming the identify: and user-data: users are colliding somehow in what gets passed into cloud-init | 22:24 |
ice10001 | I have removed the - default parameter, lets see.. | 22:25 |
ice10001 | Not that I know it will work, but am literally trying to see what could be causing issue | 22:25 |
blackboxsw | ice10001: 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 |
blackboxsw | and leave the `- default` in your `users:` list | 22:33 |
blackboxsw | then you won't have to collisions with how the live-server autoinstall is handling the ubuntu user setup. | 22:33 |
blackboxsw | and 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 time | 22:34 |
ice10001 | Let me write that so I understand... | 22:34 |
ice10001 | Oh wait... so no identity, just straight to user-data: | 22:35 |
blackboxsw | instead of https://paste.opendev.org/show/bOKYUL6wXcS0TnIFDkJ5/ I'm wildly guessing something like this 2nd paste https://paste.opendev.org/show/bIO6TFx6ksSGVRuhVRaP/ | 22:36 |
blackboxsw | yeah ice10001 like the above | 22:36 |
blackboxsw | ok I have to head out for the day. Hope that works for you or something close to that | 22:37 |
ice10001 | Thanks you so much!! | 22:37 |
Newbie | I am new here and new to cloud-init and would appreciate some guidance | 22:37 |
Newbie | has anyone tried using compressed gzip encoded userdata in alicloud? | 22:37 |
Newbie | I have been failing miserably with it to while decoding | 22:38 |
=== Guest44454 is now known as ice10001 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!