Repository navigation
Add systemd units and a basic Makefile to install - #90
Conversation
eb51e62 to
fca81c6
Compare
bgilbert
left a comment
There was a problem hiding this comment.
Moving the units upstream is probably okay, except for the assumption about the core user.
Please make sure the commit message includes the commit hash from which the unit files were taken.
| @@ -0,0 +1,10 @@ | |||
| DESTDIR ?= | |||
| PREFIX ?= $(DESTDIR)/usr | |||
There was a problem hiding this comment.
Overriding both DESTDIR and PREFIX will produce a surprising result.
| ExecStart=/usr/bin/coreos-metadata ${COREOS_METADATA_OPT_PROVIDER} --ssh-keys=%i | ||
|
|
||
| [Install] | ||
| DefaultInstance=core |
There was a problem hiding this comment.
This embeds the assumption that there is a core user. Perhaps we don't want to do that upstream?
There was a problem hiding this comment.
Good point. Hmm, that definitely makes things harder. We could add make install-units USERNAME=core or so?
There was a problem hiding this comment.
I think my vote for now is to move forward with the assumption FCOS-derived systems will also have a core user by default.
There was a problem hiding this comment.
FCOS-derived systems will have a core user, but this is going into the upstream package. Maybe default the Makefile to core, with an override?
There was a problem hiding this comment.
I just checked, and DefaultInstance= can be overridden via a drop-in (which is properly honored at enable time). I'm not much of a fan of templating this here.
There was a problem hiding this comment.
@cgwalters @bgilbert @csssuf @lucab I think that given the constraints of the problem, templating is the best solution we have. Unless anyone is strongly opposed to it, I think @cgwalters should just implement it for this pr. If we come up with a better solution later, we can revisit this.
There was a problem hiding this comment.
AFAIK the cloud image of pretty much every distro has a default user, whether it's ec2-user, ubuntu, root, etc.
Kind of...one really important detail wrt cloud-init is that that default user is only created if you don't specify another user. Concretely for Fedora Atomic (and Fedora Cloud) if you boot a cloud-init config that looks like this (a reduced version of my default one):
users:
- name: walters
gecos: Colin Walters
sudo: ALL=(ALL) NOPASSWD:ALL
ssh-authorized-keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOQkQHeKan3X+g1jILw4a3KtcfEIED0kByKGWookU7ev [email protected]
You don't get a fedora user. Or to say it conversely, the user is only created dynamically on boot - and this is different from CL today where the core user exists by default.
There was a problem hiding this comment.
So any distribution that wants to use coreos-metadata would have to choose to either do what CL does and precreate that user, or alternatively have coreos-metadata do some sort of search dynamically for the "first" human user created by Ignition (possibly one that's in the wheel/sudo group?)
The thing that makes me uncomfortable about pre-creating e.g. a core user is - what if you join the node to LDAP/ActiveDirectory or whatever and there's already a "core" user? You wouldn't want coreos-metadata granting ssh keys to that user...
In the end of course, an admin could delete the core user of course, but it does seem nicer to me to have the cloud-init semantics where it's a default user, but if you specify another one it doesn't exist.
There was a problem hiding this comment.
There's not a good way to express the "conditional default user" thing in Ignition right now; that'd be a good issue for coreos/ignition.
Note that we're talking about [email protected], not the entirety of coreos-metadata. Distros which conditionally create the default user can't unconditionally enable that unit anyway, since they don't know what account to associate it with. In that case, I think it makes sense for the distro to either
- ignore the
DefaultInstanceand always specify the desired instance, or - set the
DefaultInstanceto the conditional default user, and only enable[email protected]when the default user is actually created.
Either way, setting DefaultInstance is either useful or harmless.
a8ff849 to
e118ea8
Compare
|
tailor disable commit description |
e118ea8 to
aa0aaf9
Compare
sdemos
left a comment
There was a problem hiding this comment.
this all seems reasonable to me.
|
Also this needs a rebase on master. Shouldn't be any conflicts though. |
aa0aaf9 to
2b78cbb
Compare
|
🏄♂️ Rebased |
Ensuring user templating discussion doesn't get overlooked
|
I don't think the templating was overlooked, it seemed like there was more disagreement about whether it was necessary among the repo owners here? If no one objects to doing it though I don't mind updating this PR to do that. |
2b78cbb to
b00e4a3
Compare
|
Rebased 🏄 and updated to template per discussion. |
| @@ -0,0 +1 @@ | |||
| [email protected] No newline at end of file | |||
There was a problem hiding this comment.
Missing trailing newline.
| @@ -0,0 +1,11 @@ | |||
| [Unit] | |||
There was a problem hiding this comment.
Oops, thanks! Sorry about being slow here, I saw this comment go by and thought somehow you meant that section in the .in file should be dropped, and I started questioning whether there was some fundamental misunderstanding, then took a context switch. Anyways updated ⬇️
We're looking at adapting coreos-metdata for FCOS: <https://coreos.fedoraproject.org/> We'll need to package it again as an RPM (probably). Regardless, I think it's best to have systemd unit files upstream. Taken from: https://github.com/coreos/coreos-overlay/tree/25296501691067d3f490d62547b5de047ca28250/coreos-base/coreos-metadata/files This introduces a default template for the unit; you can change it via `make install-units DEFAULT_INSTANCE=ubuntu` or whatever.
b00e4a3 to
72823ff
Compare
|
@cgwalters sorry, github is complaining, can you rebase this one more time? |
|
ehh it'll probably merge cleanly |
This way we are truly starting from a clean slate. It means we know we won't have a `random-seed` for example. OSTree is designed to support this but unless we use it *by default* we aren't really testing it. This actually now breaks things since currently the creation of the `core` user is in `image.ks`, which we need to fix: coreos/afterburn#90 (comment)
This way we are truly starting from a clean slate. It means we know we won't have a `random-seed` for example. OSTree is designed to support this but unless we use it *by default* we aren't really testing it. This actually now breaks things since currently the creation of the `core` user is in `image.ks`, which we need to fix: coreos/afterburn#90 (comment)
We're looking at adapting coreos-metdata for FCOS.
We'll need to package it again as an RPM (probably).
Regardless, I think it's best to have systemd unit files upstream.
Taken from:
https://github.com/coreos/coreos-overlay/tree/master/coreos-base/coreos-metadata/files