=== logan_ is now known as logan- === tds7 is now known as tds [09:13] hi all ! i use Cloud-init with foreman, I have a vmware template under Centos 8, and when my vm starts my network interfaces are disconnected, I use open-vm-tools-10.3.10-3.el8 and cloud-init v18.5-7.el8, and when I delete the cloud-init package from my template it works fine, I have been looking for several hours but nothing [11:11] ? === vrubiolo1 is now known as vrubiolo === hggdh is now known as hggdh-msft [13:19] nobody uses cloud-init and open-vm-tools ? [13:28] johnsonshi: tox does attempt to detect when declared dependencies have changed and automatically recreate, but it isn't always perfect (as you now know ;). [13:32] kqkq95: The cloud-init core team are all based in US timezones, so we're only just coming online now. There are ongoing issues with VMWare and cloud-init, which the cloud-init core team don't have the expertise to address. We work with the VMWare developers who contribute to cloud-init, but as we don't have a depth of VMWare knowledge (or access to different environments etc.), there's only so much we [13:32] can do independent of them. [13:33] kqkq95: All that said, if you could run `cloud-init collect-logs` in a failing instance and make that tarball available somewhere, then I can see if there's anything obvious going on. :) [13:40] kqkq95: did you get guest customizations to work with a golden image against vmware? [13:41] I always fail because vmware won't detect that the open-vm-tools are installed till I start the vm the first time [13:41] which I especially do not want to do because it is a clean template [13:41] hi all [13:44] yes i use a vmware template under Centos 8, I do not know too much comment configure cloud-init with the value: disable_vmware_customization: false [13:45] because i configure my static network with foreman who use open-vm-tools [13:46] kqkq95: curious, if you do not mind, how did you create the template? and does vmware detect guest customizations in the template without ever starting the template on vmware? [13:47] the template was created with the official CentOS ISO [13:48] everything works fine without cloud-init :( [14:10] ok i follow this : https://kb.vmware.com/s/article/59557 [14:10] the network is now good :) [14:11] but i have error in log : https://pastebin.com/X92rReed [14:14] why eth0 show nothing while my network is good "ip address list" is ok [14:16] kqkq95: so you created the template by installing it on vmware and then convert to template? [14:17] Odd_Bloke: are you around by any chance and can help me with an ubuntu cloud image? I am trying to get rid of the console changes they do for grub [14:17] appollo13: yes [14:17] apollo13: yep [14:17] kqkq95: ah okay, how do you clean the system up afterwards? [14:18] although I guess you might just rely on cloud-init to set machine-id to something new etc [14:18] apollo13: iarf [14:18] I went another way and used virt-sysprep to pregenerate clean images but then vmware won't realize that they include guest tools *shrug* [14:18] apollo13: I don't clean... [14:19] apollo13: is there a procedure or script to put on the model ? [14:20] na I scripted it myself with packer from hashicorp to automate the install and then cleaned it with virt-sysprep and generated an ova that I could import in vmware [14:24] i can use : cloud-init clean [14:24] interesting, didn't know of that one :) [14:26] ok cloud-init show all my interfaces when i run cloud-init init :) [14:26] but why he says "Did not find any data source, search classes" [14:27] i setup a file name 10_foreman.cfg in directory /etc/cloud/cloud.cfg.d/ [14:27] apollo13: Sure, what's up? [14:28] Odd_Bloke: so ubuntu cloud-init images inject console=tty1 console=ttyS0 into grub.cfg [14:28] somewhere very early, I am trying to find out were so I can remove that [14:28] I believe it's in the shipped image. [14:28] not exactly sure why one would want a serial console :) [14:28] yes, but where :) [14:28] I am remastering the image with guestfish and I'd like to get rid of that [14:29] Oh, I see, you're asking where it's configured in the image? [14:29] debian had it in /etc/default/grub, ubuntu has it (after boot) in /etc/default/grub.d/50-cloudinit-settings.cfg [14:29] /etc/default/grub.d/50-cloudimg-settings.cfg [14:29] but the latter only exists after first boot? [14:30] I don't think so, I think it's in the shipped image. [14:30] let me recheck [14:30] (As an aside, the Ubuntu cloud images are designed to boot in as many scenarios as possible, and some places need a serial console for that.) [14:31] openstack I presume? [14:32] you might be right, I just checked the sha on my image and it doesn't match the one from https://cloud-images.ubuntu.com/focal/current/SHA1SUMS -- maybe I deleted it already [14:32] let me redownload that [14:33] I'm not sure off-hand which scenarios require it, but given how configurable OpenStack is, I'm sure there are OpenStacks that require it, yeah. :p [14:33] the funny thing is that by requiring a serial console it doesn't work on proxmox etc by default [14:33] or rather then I have to switch to serial and I rather have spice displays [14:35] Odd_Bloke: perfect the file is there, thank you. [14:37] OK, phew. :) [14:38] rharper: blackboxsw: openssh now (in focal since February) supports .d directories for ssh_config and sshd_config. I've filed two bugs related to this (basically, one for reading, one for writing): https://bugs.launchpad.net/cloud-init/+bug/1871858 https://bugs.launchpad.net/cloud-init/+bug/1871859 [14:38] Ubuntu bug 1871858 in cloud-init "cloud-init should support parsing ssh_config/sshd_config files with Include directives" [Undecided,New] [14:38] Ubuntu bug 1871859 in cloud-init "cloud-init should write ssh_config.d/sshd_config.d snippets (when supported) instead of modifying config files" [Undecided,New] [14:39] These seem like good candidates for our roadmap for next cycle to me. [14:39] powersj: rick_h_: ^ FYI. [14:40] Odd_Bloke: cool ty [14:50] Odd_Bloke: ok === cpaelzer__ is now known as cpaelzer [15:35] Hi! Is there a way to disable cloud-init to write in the root users's authorized-keys file? [15:59] andras-kovacs: What is currently being written in there that you would prefer wasn't? [16:01] Odd_Bloke: no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"myusername\" rather than the user \"root\".';echo;sleep 10" + my pubkey [16:01] Nothing, I decided to remove the whole file in the end with runcmd. [16:04] ok I have made good progress in my problem, my configuration seems good, but it seems that the client cannot reach foreman, the flows are however very open [16:04] error here : https://pastebin.com/hqnMrZFy [16:09] kqkq95: what OS do you have exactly? [16:11] what does systemctl status cloud-init.target says? [16:11] andras-kovacs: I think you are looking at #cloud-config`disable_root` and `disable_root_opts` settings [16:11] disable_root: [16:11] disable_root_opts: [16:11] https://cloudinit.readthedocs.io/en/latest/topics/modules.html#authorized-keys [16:12] you should be able to provide disable_root: false to avoid adding that to /root/.ssh/authorized_keys file [16:13] andras-kovacs: or alternately you could provide a different set of opts than the default .... no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command [16:13] by setting disable_root_opts: 'something else' [16:13] thank you! and what about the ssh pubkey? [16:14] I get it from a datastore but it would be enough if the default user would get it. [16:15] andras-kovacs: CentOS 8 [16:16] kqkq95: if cloud-init services are enabled, no file or kernel parameter which disables it, try: [16:16] mv /etc/systemd/system/cloud-init.target.wants/cloud-* /etc/systemd/system/multi-user.target.wants/ [16:16] cloud-init clean --reboot [16:16] andras-kovacs: ssh_import_id: [gh:] or ssh_authorized_keys per https://cloudinit.readthedocs.io/en/latest/topics/examples.html#configure-instances-ssh-keys [16:17] any of those keys get assigned to the default user [16:17] andras-kovacs: why mv ? [16:18] There was a significant change with cloud-init in RHEL. Previously all these services were wanted by the multiuser.target [16:18] now it moved to it's custom, cloud-init.target [16:18] It's not working for me either in RHEL 7.8 [16:18] https://bugzilla.redhat.com/show_bug.cgi?id=1820540 [16:18] bugzilla.redhat.com bug 1820540 in cloud-init "cloud-init package broken post 7.8 upgrade" [Medium,Assigned] [16:19] I know the mv part is dirty, but it is the easiest way to test it IMHO [16:19] my unit vloud* is already on multi-user.target.wants [16:19] *cloud [16:21] Moving units around is very heavyweight (and could cause upgrade problems), it would be better to add additional dependencies IMO. [16:21] andras-kovacs: cloud-init target does not exist, I have cloud-config.service, cloud-final.service, cloud-init-local.service and cloud-init.service [16:21] which version of cloud-init do you have there? :O [16:22] 18.5-7.el8 [16:22] Odd_Bloke: these are not the units just the symlinks :) Easy to revert/disable them. [16:23] Aha, right. Still, better to express a dependency on cloud-init.target, probably? [16:25] with systemctl edit yes [16:25] but it was the shortest and fastest idea to test it [16:25] but cloud-init.target is not there [16:25] yes [16:27] ha I have the same question as andras-kovacs, disable_root: false and ssh_authorized_keys still writes to root as well as the configured user [16:28] just tested on ubuntu focal [16:28] runcmd: [16:28] - rm -f /root/.ssh/authorized_keys [16:28] it will be fine for me [16:28] that will work, but if my user actually set root as the default user I'd remove that again… [16:29] * apollo13 checks cloud-init source [16:29] oh you are right :S [16:29] but the funny thing is runcmd doesn't work if there is LVM on the server (which is sick in cloud env, I know I know.. .but still a requirement) [16:29] And there is no info in the logs about it why :( [16:30] at the end of the day I made a custom systemd unit which replaces the runcmd part and destroys itself [16:30] looking at current master of cloud-init: https://dpaste.org/zi5J/raw [16:30] and noone should use the root user as the default one [16:31] doesn't look as if there were __any__ way to disable setting the key for root [16:31] openssh is not bulletproof (nothing is) [16:31] apollo13:/andras-kovacs hrm right disable_root is actually saying any configured ssh keys are put in both root and because we expect users may have accidentally tried to login as root and we steer them to the actual default user instead with a printed message breadcrumb. [16:31] andras-kovacs: there's no interesection between lvm and runcmd ... are you seeing an error in cloud-init status or cloud-init.log ? or expecting output from runcmd to be somewhere on the filesystem and it's not ? [16:31] blackboxsw: yeah I'd like to prevent that because it leaks user information [16:31] so apollo13 andras-kovacs is the feature, that you want cloud-init to avoid touching root at all? [16:32] and only setup default_user [16:32] andras-kovacs: no idea for me :( [16:32] yes [16:32] blackboxsw: if use X is configured as default_user I do not want the ssh keys applied to root [16:32] yes [16:32] if user X * [16:33] blackboxsw: I totally got your point and I was thinking previously like how smart was it. [16:33] andras-kovacs: funny though that we have the same problem the same day :D and I am pretty sure I do not know you [16:33] to think about this scenario [16:33] I know there is a way to avoid dropping keys in root && default_user. just trying to think it through. [16:34] set an immutable flag on it (but cloud-init would probably fail?) [16:34] blackboxsw: looking at the link I just posted from cloud-init master I doubt it [16:34] I'll remove it at the end, that should be ok. [16:35] andras-kovacs: setting immutable would work, but that also means you have to generate .ssh/authorized_keys in the first place since it's not there by default [16:37] apollo13: yes and I have a feeling cloud-init would fail (maybe silently) if it can't write there [16:37] so I'll remove the file in the runcmd part at the end [16:38] is there any way to allow password logins? [16:39] and yes I know it's insecure, but it is just to allow initial login on the box and easy testing, our cfg mgmt will forbid it globally anyways [16:39] ssh_pwauth: True [16:39] password: XXXXXX [16:39] ah thx [16:40] chpasswd: { expire: False } [16:40] that's in my debugging user-data [16:41] andras-kovacs: apollo13 yeah looks like a feature request for cloud-init to avoid reflecting/disabled keys into 'root' user's authorized_keys file. [16:41] as you mentioned. [16:42] a bug would be nice for that and upstream can discuss whether this is a feature is something that we will be tackling in short term. [16:42] rharper: mhm, I am having a hard time finding what "password" does [16:43] ah it's from the default user, nevermind [16:43] the docs are confusing sometimes [16:44] interesting enough proxmox sets chpasswd.expire: false but not ssh_pwauth :D [16:45] apollo13: yeah; some of this config is quite old so it's not well scoped under which module uses it; [16:46] blackboxsw: https://bugs.launchpad.net/cloud-init/+filebug ? [16:46] yes please apollo13 [16:47] just describe the feature and we'll triage it and determine how best to address it. [16:47] ffs I tried searching if such a bug already exists but timeout error on search [16:47] so might be a dupe :/ [16:52] no worries, can check that. [16:52] thanks [16:54] blackboxsw: https://bugs.launchpad.net/cloud-init/+bug/1871879 -- not the end of the world for me, but would be nice if there were an option to disable it. Thanks for caring! [16:54] Ubuntu bug 1871879 in cloud-init "Configuring a user should not configure root's authorized_keys" [Undecided,New] [18:25] Odd_Bloke: rharper I have updated the branching/cherry-pick process spec https://hackmd.io/VbmtcZLyR4650aqqmfMMYg to reflect yesterday's conversation and I have updated tooling to codify that. [18:26] I'm about to push up doc changes to uss-tableflip PR#45 and cloud-init PR 308 with the steps to fix daily build recipe [19:35] ok rharper Odd_Bloke I've closed 308 in favor of manual PR https://github.com/canonical/cloud-init/pull/312 for fixing ubuntu daily build recipe [19:36] thanks for the discussions yesterday about the best approach for branch management to avoid push/pop of cpicks in the ubuntu/series branches [19:40] blackboxsw: ok ... I'll try to look; grinding through some more curtin bits first === tds7 is now known as tds [22:50] rharper: responded to the big question https://github.com/CanonicalLtd/uss-tableflip/pull/45#discussion_r406505316 [22:52] and updated that I misread your 2nd question there [23:10] I think I may have missed the point of your question about 'only needing the commit' from ubuntu/devel in ubuntu/daily/devel in order to revert. [23:11] so I think on rereading the 3rd time yoy may have meant that ubuntu/daily/devel could actually just 'git cherry-pick cpick_commit_from_ubuntu_devel; git revert cpick_commit_from_ubuntu_devel' ? maybe [23:22] the issue with just git cherry-picking a single commit into ubuntu/daily/devel and reverting it is that ubuntu/daily/devel is essentially a downstream, so that revert we'd perform there is on a comittish that is local only do ubuntu/daily/devel branch, so it won't revert the parent's commitish. [23:22] ... when we merge back ubuntu/daily/devel into ubuntu/devel for daily recipe builds