Skip to content

Commit

Permalink
Use Ignition to create core user
Browse files Browse the repository at this point in the history
Create the core user in the Ignition base config and allow users to
modify it via config merging.  This fixes the user not receiving default
groups if anything about the user (e.g. SSH keys) is specified via
Ignition.
  • Loading branch information
bgilbert committed Mar 27, 2019
1 parent b783139 commit 7e1fb3f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 15 deletions.
19 changes: 19 additions & 0 deletions overlay/usr/lib/dracut/modules.d/40ignition-conf/base.ign
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"ignition": {
"version": "3.0.0"
},
"passwd": {
"users": [
{
"name": "core",
"gecos": "CoreOS Admin",
"groups": [
"adm",
"sudo",
"systemd-journal",
"wheel"
]
}
]
}
}
12 changes: 12 additions & 0 deletions overlay/usr/lib/dracut/modules.d/40ignition-conf/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

depends() {
echo ignition
}

install() {
inst "$moddir/base.ign" \
"/usr/lib/ignition/base.ign"
}
1 change: 0 additions & 1 deletion overlay/usr/lib/systemd/system-preset/42-coreos.preset
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Presets here that eventually should live in the generic fedora presets
enable coreos-growpart.service
enable coreos-useradd-core.service
enable console-login-helper-messages-*.service
enable console-login-helper-messages-*.path
# This one is from https://github.com/coreos/ignition-dracut
Expand Down
14 changes: 0 additions & 14 deletions overlay/usr/lib/systemd/system/coreos-useradd-core.service

This file was deleted.

0 comments on commit 7e1fb3f

Please sign in to comment.