diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2021-01-13 10:26:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-13 10:26:32 -0500 |
commit | 37abbc43334d522cfbda595fcee2e52592b4d354 (patch) | |
tree | 38a8e873b16eb94711845bdf2258c60950346b2f /cloudinit | |
parent | 503435d1b2deb648c3cfc436f1e40b8ad86260fc (diff) | |
download | vyos-cloud-init-37abbc43334d522cfbda595fcee2e52592b4d354.tar.gz vyos-cloud-init-37abbc43334d522cfbda595fcee2e52592b4d354.zip |
cc_seed_random: update documentation and fix integration test (#771)
The documentation did not mention that the given data may not be the
exact string written: the cloud's random data may be added to it.
Additionally, the documentation of the command key was incorrect.
test_seed_random_data was updated to check that the given data is a
prefix of the written data, to match cloud-init's expected (and, now,
documented) behaviour.
LP: #1911227
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/config/cc_seed_random.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cloudinit/config/cc_seed_random.py b/cloudinit/config/cc_seed_random.py index 4fb9b44e..911789c7 100644 --- a/cloudinit/config/cc_seed_random.py +++ b/cloudinit/config/cc_seed_random.py @@ -24,15 +24,19 @@ Configuration for this module is under the ``random_seed`` config key. The optionally be specified in encoded form, with the encoding specified in ``encoding``. +If the cloud provides its own random seed data, it will be appended to ``data`` +before it is written to ``file``. + .. note:: when using a multiline value for ``data`` or specifying binary data, be sure to follow yaml syntax and use the ``|`` and ``!binary`` yaml format specifiers when appropriate -Instead of specifying a data string, a command can be run to generate/collect -the data to be written. The command should be specified as a list of args in -the ``command`` key. If a command is specified that cannot be run, no error -will be reported unless ``command_required`` is set to true. +If the ``command`` key is specified, the given command will be executed. This +will happen after ``file`` has been populated. That command's environment will +contain the value of the ``file`` key as ``RANDOM_SEED_FILE``. If a command is +specified that cannot be run, no error will be reported unless +``command_required`` is set to true. For example, to use ``pollinate`` to gather data from a remote entropy server and write it to ``/dev/urandom``, the following could be |