summaryrefslogtreecommitdiff
path: root/systemd/disable-sshd-keygen-if-cloud-init-active.conf
diff options
context:
space:
mode:
Diffstat (limited to 'systemd/disable-sshd-keygen-if-cloud-init-active.conf')
-rw-r--r--systemd/disable-sshd-keygen-if-cloud-init-active.conf7
1 files changed, 7 insertions, 0 deletions
diff --git a/systemd/disable-sshd-keygen-if-cloud-init-active.conf b/systemd/disable-sshd-keygen-if-cloud-init-active.conf
new file mode 100644
index 00000000..1a5d7a5a
--- /dev/null
+++ b/systemd/disable-sshd-keygen-if-cloud-init-active.conf
@@ -0,0 +1,7 @@
+# In some cloud-init enabled images the sshd-keygen template service may race
+# with cloud-init during boot causing issues with host key generation. This
+# drop-in config adds a condition to sshd-keygen@.service if it exists and
+# prevents the sshd-keygen units from running *if* cloud-init is going to run.
+#
+[Unit]
+ConditionPathExists=!/run/systemd/generator.early/multi-user.target.wants/cloud-init.target