diff --git a/autoupdate-unit/Containerfile b/autoupdate-unit/Containerfile new file mode 100644 index 0000000..99bd78f --- /dev/null +++ b/autoupdate-unit/Containerfile @@ -0,0 +1,6 @@ +# This example injects a systemd unit to perform automatic daily OS updates. +FROM quay.io/fedora/fedora-coreos:stable +# The key content is in [usr/lib/systemd/system](usr/lib/systemd/system) +ADD usr usr +# At the current time, zincati cannot be used for container updates. More in https://github.com/coreos/fedora-coreos-tracker/issues/1263 +RUN systemctl mask zincati diff --git a/autoupdate-unit/usr/lib/systemd/system/autoupdate-host.service b/autoupdate-unit/usr/lib/systemd/system/autoupdate-host.service new file mode 100644 index 0000000..429799b --- /dev/null +++ b/autoupdate-unit/usr/lib/systemd/system/autoupdate-host.service @@ -0,0 +1,8 @@ +[Unit] +Description=Automatic host upgrades +[Service] +Type=simple +# Note that this will be a no-op if there are no changes. +ExecStart=rpm-ostree upgrade --reboot +# We'll use https://github.com/coreos/rpm-ostree/pull/4384 in the future +StandardOutput=null \ No newline at end of file diff --git a/autoupdate-unit/usr/lib/systemd/system/autoupdate-host.timer b/autoupdate-unit/usr/lib/systemd/system/autoupdate-host.timer new file mode 100644 index 0000000..dea07c8 --- /dev/null +++ b/autoupdate-unit/usr/lib/systemd/system/autoupdate-host.timer @@ -0,0 +1,7 @@ +[Unit] +Description=Automatic daily host upgrades +[Timer] +OnBootSec=1h +OnUnitInactiveSec=1d +[Install] +WantedBy=timers.target diff --git a/autoupdate-unit/usr/lib/systemd/system/timers.target.wants/autoupdate-host.timer b/autoupdate-unit/usr/lib/systemd/system/timers.target.wants/autoupdate-host.timer new file mode 120000 index 0000000..fe34006 --- /dev/null +++ b/autoupdate-unit/usr/lib/systemd/system/timers.target.wants/autoupdate-host.timer @@ -0,0 +1 @@ +../autoupdate-host.timer \ No newline at end of file