/srv/irclogs.ubuntu.com/2020/01/03/#cloud-init.txt

SnoFoxHello. I have an Amazon Linux 2 VM that seems to have removed the cloud-init binary and systemd units. I feel like I'm misunderstanding the purpose of the tool - I don't see anything funny in userdata to cause that nor am I finding anything in the docs about persistence. Is this expected or is Amazon doing weird things?00:51
MKS2020Hello, i’d like report a bug at line https://github.com/canonical/cloud-init/blame/8116493950e7c47af0ce66fc1bb5d799ce5e477a/cloudinit/ssh_util.py#L260 not sure if this IRC channel is the right place.13:50
MKS2020cloud-init’s code by default makes a wrong assumption that all users using private .ssh folder for authorized_keys.13:52
gnulnxmeena: Chef isn't even being installed.  The inital directories are created, but there is no chef-client binary, and the logs just say "running module chef ... failed", and "Ran chef but it failed!"13:57
gnulnxThe cloud-init logs ^13:57
MKS2020But `AuthorizedKeysFile` directive in sshd_config could be used to have a system-wide folder with user keys which are managed by configuration management systems, for example puppet. The idea is to have configuration like `AuthorizedKeysFile /etc/ssh/authorized_keys/%u` to prevent users manage their authorized_keys or to rootkit other users from user who had a sudo permissions on host. Folder `/etc/ssh/authorized_keys/` and all files inside are owned b13:58
MKS2020root because user shouldn’t be able to modify this files. When cloud-init change mode to 700 for such folder it breaks whole consept.13:58
MKS2020so before applying 700 to folder defined in `AuthorizedKeysFile` cloud-init needs to validate that that folder located within user’s HOME folder.14:07
meenagnulnx: how is chef being installed?14:30
gnulnxmeena: `install_type: "omnibus"`14:32
meenaMKS2020: do you think you can patch that?14:32
meenagnulnx: ooohhh, aah? okay?14:32
gnulnxOne sec, I'm pasting my config14:32
MKS2020meena: yes, https://github.com/canonical/cloud-init/pull/14914:32
meenaMKS2020: i haven't looked all day at GitHub, i'm in a new paid job… and i…'ve mostly been busy setting up my laptop, 😆14:33
meenaMKS2020: did you look at https://github.com/canonical/cloud-init/blob/master/HACKING.rst ?14:34
MKS2020hehe, it can wait right now we’re fixing this issue with runcmd: "awk  '/^AuthorizedKeysFile/ {print $2}' /etc/ssh/sshd_config | xargs dirname | xargs chmod 755" in our code but it really hard to use our own AMIs across different accounts and departments :)14:35
gnulnxmeena: https://gist.github.com/kylejohnson/e44a1d72b634dd7fade4fc830f2a7ae6 is what I have14:36
MKS2020meena: yep, i’m at the middle of https://ubuntu.com/legal/contributors/agreement now14:36
meenaMKS2020: oh. that was simpler than i thought… also: can you show us your cloud-init config that let's you do / break that? (as a comment to PR perhaps)14:37
MKS2020meena: ok, i’ll describe steps to reproduce a bug14:38
MKS2020meena: what should i write in `Please add the Canonical Project Manager or contact` ?14:40
meenaMKS2020: that would be powersj14:40
meenagnulnx: we don't even capture if anything goes wrong in the installer: https://github.com/canonical/cloud-init/blob/master/cloudinit/config/cc_chef.py#L30814:44
meenagnulnx: so, i'd start by toggling that Flag, and seeing if you get more useful output.14:44
gnulnxJust toggle Capture and re-run?14:45
meenagnulnx: set capture=True; run cloud-init clean --logs --reboot ; and enjoy the show14:47
gnulnxthank ya14:50
gnulnxI've been doing rm -rf sem; cloud-init -d single --name chef14:51
gnulnxWould that get me (close to) the same result?14:51
gnulnxmeena: https://gist.github.com/kylejohnson/1a157062f1bccc7106e9de2ed5cd639e14:54
gnulnxThat's interesting.  It doesn't like any of my cef keys14:55
MKS2020meena: i’ve submited agreement and added steps to reproduce into MR. Let me know if some information is needed/missed from my side.14:55
=== tds3 is now known as tds
meena15:51 <gnulnx> Would that get me (close to) the same result? ⬅️ no. clean nukes /var/lib/cloud-init and /run/cloud-init19:02
meenahttps://cloudinit.readthedocs.io/en/latest/topics/modules.html#chef this documentation seems to be incomplete, and, confusing19:09
gnulnxmeena: Yeah, that's what I found too.  The documentation doesn't look up to date.19:19
meenagnulnx: which version are you on, btw?19:22
gnulnxmeena: 19.3-4119:23
meenalet's open… at least one bug, gnulnx .19:24
gnulnxOh what's that?19:27
gnulnxSo I added `validation_name: test` and it actually installed chef this time19:27
gnulnxInstalled, daemonized and forked19:28
meenagnulnx: so that's that then19:55
gnulnxyup20:03

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