Skip to content
Merged
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
9 changes: 8 additions & 1 deletion cloudinit/config/cc_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
key types. Not all key types have to be specified, ones left unspecified will
not be used. If this config option is used, then no keys will be generated.

When host keys are generated the output of the ssh-keygen command(s) can be
displayed on the console using the ``ssh_quiet_keygen`` configuration key.
This settings defaults to False which displays the keygen output.

.. note::
when specifying private host keys in cloud-config, care should be taken to
ensure that the communication between the data source and the instance is
Expand Down Expand Up @@ -151,6 +155,7 @@
ssh_publish_hostkeys:
enabled: <true/false> (Defaults to true)
blacklist: <list of key types> (Defaults to [dsa])
ssh_quiet_keygen: <true/false>
"""

import glob
Expand Down Expand Up @@ -239,7 +244,9 @@ def handle(_name, cfg, cloud, log, _args):
with util.SeLinuxGuard("/etc/ssh", recursive=True):
try:
out, err = subp.subp(cmd, capture=True, env=lang_c)
sys.stdout.write(util.decode_binary(out))
if not util.get_cfg_option_bool(cfg, 'ssh_quiet_keygen',
False):
sys.stdout.write(util.decode_binary(out))

gid = util.get_group_id("ssh_keys")
if gid != -1:
Expand Down