Skip to content

Commit

Permalink
Merge pull request #21161 from cgwalters/machine-autologin-console
Browse files Browse the repository at this point in the history
machine: Enable console autologin by default
  • Loading branch information
openshift-merge-bot[bot] authored Jan 13, 2024
2 parents 1783142 + 992e83d commit a2fcca4
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion pkg/machine/ignition/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ func (ign *DynamicIgnition) GenerateIgnitionConfig() error {
ignStorage.Links = append(ignStorage.Links, tzLink)
}

// Enables automatic login on the console;
// there's no security concerns here, and this makes debugging easier.
// xref https://docs.fedoraproject.org/en-US/fedora-coreos/tutorial-autologin/
var autologinDropin = `[Service]
ExecStart=
ExecStart=-/usr/sbin/agetty --autologin root --noclear %I $TERM
`

deMoby := parser.NewUnitFile()
deMoby.Add("Unit", "Description", "Remove moby-engine")
deMoby.Add("Unit", "After", "systemd-machine-id-commit.service")
Expand Down Expand Up @@ -220,7 +228,26 @@ func (ign *DynamicIgnition) GenerateIgnitionConfig() error {
Enabled: BoolToPtr(false),
Name: "zincati.service",
},
}}
{
Name: "[email protected]",
Dropins: []Dropin{
{
Name: "10-autologin.conf",
Contents: &autologinDropin,
},
},
},
{
Name: "[email protected]",
Dropins: []Dropin{
{
Name: "10-autologin.conf",
Contents: &autologinDropin,
},
},
},
},
}

// Only qemu has the qemu firmware environment setting
if ign.VMType == define.QemuVirt {
Expand Down

0 comments on commit a2fcca4

Please sign in to comment.