Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/redhat/cloud-init.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ fi

%if "%{init_system}" == "systemd"
/usr/lib/systemd/system-generators/cloud-init-generator
%{_sysconfdir}/systemd/system/sshd-keygen@.service.d/disable-sshd-keygen-if-cloud-init-active.conf
%{_unitdir}/cloud-*
%else
%attr(0755, root, root) %{_initddir}/cloud-config
Expand Down
1 change: 1 addition & 0 deletions packages/suse/cloud-init.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ version_pys=$(cd "%{buildroot}" && find . -name version.py -type f)

%{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient
%{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager
%{_sysconfdir}/systemd/system/sshd-keygen@.service.d/disable-sshd-keygen-if-cloud-init-active.conf

# Python code is here...
%{python_sitelib}/*
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def is_generator(p):
def pkg_config_read(library, var):
fallbacks = {
'systemd': {
'systemdsystemconfdir': '/etc/systemd/system',
'systemdsystemunitdir': '/lib/systemd/system',
'systemdsystemgeneratordir': '/lib/systemd/system-generators',
}
Expand Down Expand Up @@ -270,7 +271,9 @@ def finalize_options(self):
(ETC + '/NetworkManager/dispatcher.d/',
['tools/hook-network-manager']),
(ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']),
(LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')])
(LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')]),
(ETC + '/systemd/system/sshd-keygen@.service.d/',
['systemd/disable-sshd-keygen-if-cloud-init-active.conf']),
])
# Use a subclass for install that handles
# adding on the right init system configuration files
Expand Down
8 changes: 8 additions & 0 deletions systemd/disable-sshd-keygen-if-cloud-init-active.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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
EOF