diff options
author | James Falcon <james.falcon@canonical.com> | 2022-10-07 11:51:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 10:51:01 -0600 |
commit | cd2cca35a1bf36b584422f431c3ddf55b820434c (patch) | |
tree | 537244c556b79f6b8ba92d5706bf3e63c64e64d3 | |
parent | 761b23bdb2402ab3fc1d709a59f8eb86c321a854 (diff) | |
download | cloud-init-git-cd2cca35a1bf36b584422f431c3ddf55b820434c.tar.gz |
Create reference documentation for base config
Also add schema entries for the base config modules lists that can be
overridden with user data.
-rw-r--r-- | cloudinit/config/schemas/schema-cloud-config-v1.json | 131 | ||||
-rw-r--r-- | config/cloud.cfg.tmpl | 3 | ||||
-rw-r--r-- | doc/examples/cloud-config.txt | 12 | ||||
-rw-r--r-- | doc/rtd/index.rst | 9 | ||||
-rw-r--r-- | doc/rtd/topics/base_config_reference.rst | 363 | ||||
-rw-r--r-- | doc/rtd/topics/datasources/exoscale.rst | 5 | ||||
-rw-r--r-- | doc/rtd/topics/datasources/smartos.rst | 4 | ||||
-rw-r--r-- | doc/rtd/topics/faq.rst | 3 | ||||
-rw-r--r-- | doc/rtd/topics/instancedata.rst | 10 | ||||
-rw-r--r-- | doc/rtd/topics/logging.rst | 6 | ||||
-rw-r--r-- | doc/rtd/topics/module_creation.rst | 4 | ||||
-rw-r--r-- | doc/rtd/topics/network-config-format-v1.rst | 3 | ||||
-rw-r--r-- | doc/rtd/topics/network-config-format-v2.rst | 3 | ||||
-rw-r--r-- | doc/rtd/topics/network-config.rst | 2 | ||||
-rw-r--r-- | tests/unittests/config/test_schema.py | 1 |
15 files changed, 533 insertions, 26 deletions
diff --git a/cloudinit/config/schemas/schema-cloud-config-v1.json b/cloudinit/config/schemas/schema-cloud-config-v1.json index 42dc7ebc..9b314077 100644 --- a/cloudinit/config/schemas/schema-cloud-config-v1.json +++ b/cloudinit/config/schemas/schema-cloud-config-v1.json @@ -1,6 +1,111 @@ { "$schema": "http://json-schema.org/draft-04/schema#", "$defs": { + "all_modules": { + "enum": [ + "ansible", + "apk-configure", + "apk_configure", + "apt-configure", + "apt_configure", + "apt-pipelining", + "apt_pipelining", + "bootcmd", + "byobu", + "ca-certs", + "ca_certs", + "chef", + "disable-ec2-metadata", + "disable_ec2_metadata", + "disk-setup", + "disk_setup", + "fan", + "final-message", + "final_message", + "growpart", + "grub-dpkg", + "grub_dpkg", + "install-hotplug", + "install_hotplug", + "keyboard", + "keys-to-console", + "keys_to_console", + "landscape", + "locale", + "lxd", + "mcollective", + "migrator", + "mounts", + "ntp", + "package-update-upgrade-install", + "package_update_upgrade_install", + "phone-home", + "phone_home", + "power-state-change", + "power_state_change", + "puppet", + "refresh-rmc-and-interface", + "refresh_rmc_and_interface", + "reset-rmc", + "reset_rmc", + "resizefs", + "resolv-conf", + "resolv_conf", + "rh-subscription", + "rh_subscription", + "rightscale-userdata", + "rightscale_userdata", + "rsyslog", + "runcmd", + "salt-minion", + "salt_minion", + "scripts-per-boot", + "scripts_per_boot", + "scripts-per-instance", + "scripts_per_instance", + "scripts-per-once", + "scripts_per_once", + "scripts-user", + "scripts_user", + "scripts-vendor", + "scripts_vendor", + "seed-random", + "seed_random", + "set-hostname", + "set_hostname", + "set-passwords", + "set_passwords", + "snap", + "spacewalk", + "ssh", + "ssh-authkey-fingerprints", + "ssh_authkey_fingerprints", + "ssh-import-id", + "ssh_import_id", + "timezone", + "ubuntu-advantage", + "ubuntu_advantage", + "ubuntu-autoinstall", + "ubuntu_autoinstall", + "ubuntu-drivers", + "ubuntu_drivers", + "update-etc-hosts", + "update_etc_hosts", + "update-hostname", + "update_hostname", + "users-groups", + "users_groups", + "wireguard", + "write-files", + "write_files", + "write-files-deferred", + "write_files_deferred", + "yum-add-repo", + "yum_add_repo", + "zypper-add-repo", + "zypper_add_repo" + ] + }, "users_groups.groups_by_groupname": { "additionalProperties": false, "patternProperties": { @@ -231,6 +336,31 @@ }, "minProperties": 1 }, + "modules_definition": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/$defs/all_modules" + }, + { + "type": "array", + "prefixItems": [ + { "enum": {"$ref": "#/$defs/all_modules"}}, + { "enum": ["always", "once", "once-per-instance"]} + ] + } + ] + } + }, + "base_config": { + "type": "object", + "properties": { + "cloud_init_modules": {"$ref": "#/$defs/modules_definition"}, + "cloud_config_modules": {"$ref": "#/$defs/modules_definition"}, + "cloud_final_modules": {"$ref": "#/$defs/modules_definition"} + } + }, "cc_ubuntu_autoinstall": { "type": "object", "properties": { @@ -2684,6 +2814,7 @@ } }, "allOf": [ + { "$ref": "#/$defs/base_config"}, { "$ref": "#/$defs/cc_ansible" }, { "$ref": "#/$defs/cc_apk_configure" }, { "$ref": "#/$defs/cc_apt_configure" }, diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl index fa250a51..daf31d12 100644 --- a/config/cloud.cfg.tmpl +++ b/config/cloud.cfg.tmpl @@ -1,6 +1,7 @@ ## template:jinja + # The top level settings are used as module -# and system configuration. +# and base configuration. {% set is_bsd = variant in ["dragonfly", "freebsd", "netbsd", "openbsd"] %} {% set is_rhel = variant in ["rhel", "centos"] %} {% if is_bsd %} diff --git a/doc/examples/cloud-config.txt b/doc/examples/cloud-config.txt index 7f4ded8c..15d788f3 100644 --- a/doc/examples/cloud-config.txt +++ b/doc/examples/cloud-config.txt @@ -143,17 +143,6 @@ bootcmd: - echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts - [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ] -# cloud_config_modules: -# default: -# cloud_config_modules: -# - mounts -# - ssh -# - apt-update-upgrade -# - puppet -# - updates-check -# - disable-ec2-metadata -# - runcmd -# # This is an array of arrays or strings. # if item is a string, then it is read as a module name # if the item is an array it is of the form: @@ -171,7 +160,6 @@ cloud_config_modules: - grub-dpkg - [ apt-update-upgrade, always ] - puppet - - updates-check - disable-ec2-metadata - runcmd - byobu diff --git a/doc/rtd/index.rst b/doc/rtd/index.rst index 682c7c83..159113f4 100644 --- a/doc/rtd/index.rst +++ b/doc/rtd/index.rst @@ -63,7 +63,6 @@ Having trouble? We would like to help! topics/format.rst topics/examples.rst topics/events.rst - topics/modules.rst topics/merging.rst .. toctree:: @@ -79,6 +78,14 @@ Having trouble? We would like to help! .. toctree:: :hidden: :titlesonly: + :caption: Reference + + topics/base_config_reference.rst + topics/modules.rst + +.. toctree:: + :hidden: + :titlesonly: :caption: Development topics/contributing.rst diff --git a/doc/rtd/topics/base_config_reference.rst b/doc/rtd/topics/base_config_reference.rst new file mode 100644 index 00000000..97abcff5 --- /dev/null +++ b/doc/rtd/topics/base_config_reference.rst @@ -0,0 +1,363 @@ +.. _base_config_reference: + +Base Configuration +****************** + +.. warning:: + This documentation is intended for custom image creators, such as + distros and cloud providers, not + end users. Modifying the base configuration should not be necessary for + end users and can result in a system that may be unreachable or + may no longer boot. + +Cloud-init base config is primarily defined in two places: + +* **/etc/cloud/cloud.cfg** +* **/etc/cloud/cloud.cfg.d/*.cfg** + +See the :ref:`configuration sources explanation<configuration>` for more +information on how these files get sourced and combined with other +configuration. + +Generation +========== + +``cloud.cfg`` isn't present in any of cloud-init's source files. The +`configuration is templated`_ and customized for each +distribution supported by cloud-init. + +Base Configuration Keys +======================= + +Module Keys +----------- + +Modules are grouped into the following keys: + +* **cloud_init_modules**: Modules run during + :ref:`network<topics/boot:network>` timeframe. +* **cloud_config_modules**: Modules run during + :ref:`config<topics/boot:config>` timeframe. +* **cloud_final_modules**: Modules run during + :ref:`final<topics/boot:final>` timeframe. + +Each ``modules`` definition contains an array of strings, where each string +is the name of the module. Each name is taken directly from the +module filename, +with the ``cc_`` prefix and ``.py`` suffix removed, and with +``-`` and ``_`` being interchangeable. + +Alternatively, in place of the module name, an array of +`<name>, <frequency>[, <args>]` args may be specified. See +:ref:`the module creation guidelines<topics/module_creation:guidelines>` for +more information on ``frequency`` and ``args``. + +.. note:: + Most modules won't run at all if they're not triggered via a + respective user data key, so removing modules or changing the run + frequency is **not** a recommended way to reduce instance boot time. + +Examples +^^^^^^^^ + +To specify that only `cc_final_message.py`_ run during final +timeframe: + +.. code-block:: yaml + + cloud_final_modules: + - final_message + +To change the frequency from the default of ``ALWAYS`` to ``ONCE``: + +.. code-block:: yaml + + cloud_final_modules: + - [final_message, once] + +To include default arguments to the module (that may be overridden by +user data): + +.. code-block:: yaml + + cloud_final_modules: + - [final_message, once, "my final message"] + +.. _datasource_base_config: + +Datasource Keys +--------------- + +Many datasources allow configuration of the datasource for use in +querying the datasource for metadata using the ``datasource`` key. +This configuration is datasource dependent and can be found under +each datasource's respective :ref:`documentation<datasources>`. It will +generally take the form of: + +.. code-block:: yaml + + datasource: + <datasource_name>: + ... + +System Info Keys +---------------- +These keys are used for setup of cloud-init itself, or the datasource +or distro. Anything under the ``system_info`` cannot be overridden by +vendor data, user data, or any other handlers or transforms. In some cases, +there may be a ``system_info`` key used for the distro, while the same +key is used outside of ``system_info`` for a userdata module. +Both keys will be processed independently. + +* **system_info**: Top-level key + + - **paths**: Definitions of common paths used by cloud-init + + + **cloud_dir**: Defaults to ``/var/lib/cloud`` + + **templates_dir**: Defaults to ``/etc/cloud/templates`` + + - **distro**: Name of distro being used. + - **default_user**: Defines the default user for the system using the same + user configuration as :ref:`topics/modules:users and groups`. Note that + this CAN be overridden if a ``users`` configuration + is specified without a ``- default`` entry. + - **ntp_client**: The default ntp client for the distro. Takes the same + form as ``ntp_client`` defined in :ref:`topics/modules:ntp`. + - **package_mirrors**: Defines the package mirror info for apt. + - **ssh_svcname**: The ssh service name. For most distros this will be + either ``ssh`` or ``sshd``. + - **network**: Top-level key for distro-specific networking configuration + + + **renderers**: Prioritized list of networking configurations to try + on this system. The first valid entry found will be used. + Options are: + + * **eni** - For /etc/network/interfaces + * **network-manager** + * **netplan** + * **networkd** - For systemd-networkd + * **freebsd** + * **netbsd** + * **openbsd** + + + **activators**: Prioritized list of networking tools to try to activate + network on this system. The first valid entry found will be used. + Options are: + + * **eni** - For ``ifup``/``ifdown`` + * **netplan** - For ``netplan generate``/``netplan apply`` + * **network-manager** - For ``nmcli connection load``/ + ``nmcli connection up`` + * **networkd** - For ``ip link set up``/``ip link set down`` + +Logging Keys +------------ + +See :ref:`the logging explanation<logging>` for a comprehensive +logging explanation. Note that cloud-init has a default logging +definition that shouldn't need to be altered. It is defined on the +instance at ``/etc/cloud/cloud.cfg.d/05_logging.cfg``. + +The logging keys used in the base configuration are as follows: + +**logcfg**: A standard python `fileConfig`_ formatted log configuration. +This is the primary logging configuration key and will take precedence over +**log_cfgs** or **log_basic** keys. + +**log_cfgs**: A list of logging configs in `fileConfig`_ format to apply +when running cloud-init. Note that **log_cfgs** is used in +``/etc/cloud.cfg.d/05_logging.cfg``. + +**log_basic**: Boolean value to determine if cloud-init should apply a +basic default logging configuration if none has been provided. Defaults +to ``true`` but only takes effect if **logcfg** or **log_cfgs** hasn't +been defined. + +**output**: If and how to redirect stdout/stderr. Defined in +``/etc/cloud.cfg.d/05_logging.cfg`` and explained in +:ref:`the logging explanation<logging_command_output>`. + +**syslog_fix_perms**: Takes a list of ``<owner:group>`` strings and will set +the owner of **def_log_file** accordingly. + +**def_log_file**: Only used in conjunction with **syslog_fix_perms**. +Specifies the filename to be used for setting permissions. Defaults +to ``/var/log/cloud-init.log``. + +Other Keys +---------- + +**network**: The :ref:`network_config` to be applied to this instance. + +**datasource_pkg_list**: Prioritized list of python packages to search when +finding a datasource. Automatically includes ``cloudinit.sources``. + +**datasource_list**: Prioritized list of datasources that cloud-init will +attempt to find on boot. By default, this will be defined in +``/etc/cloud/cloud.cfg.d``. There are two primary use cases for modifying +the datasource_list: + +1. Remove known invalid datasources. This may avoid long timeouts attempting + to detect datasources on any system without a systemd-generator hook + that invokes ds-identify. +2. Override default datasource ordering to discover a different datasource + type than would typically be prioritized. + +If **datasource_list** has only a single entry (or a single entry + ``None``), +:ref:`cloud-init's generator script<topics/boot:generator>` +will automatically assume and use this datasource without +attempting detection. + +**vendor_data**/**vendor_data2**: Allows the user to disable ``vendor_data`` +or ``vendor_data2`` along with providing a prefix for any executed scripts. + +Format is a dict with ``enabled`` and ``prefix`` keys: + +* **enabled**: Boolean indicating whether to enable or disable the vendor_data +* **prefix**: A path to prepend to any vendor_data provided script + +Example +======= + +On an ubuntu system, ``/etc/cloud/cloud.cfg`` should look similar to: + +.. code-block:: yaml + + # The top level settings are used as module and base configuration. + # A set of users which may be applied and/or used by various modules + # when a 'default' entry is found it will reference the 'default_user' + # from the distro configuration specified below + users: + - default + + + # If this is set, 'root' will not be able to ssh in and they + # will get a message to login instead as the default $user + disable_root: true + + # This will cause the set+update hostname module to not operate (if true) + preserve_hostname: false + + # If you use datasource_list array, keep array items in a single line. + # If you use multi line array, ds-identify script won't read array items. + # Example datasource config + # datasource: + # Ec2: + # metadata_urls: [ 'blah.com' ] + # timeout: 5 # (defaults to 50 seconds) + # max_wait: 10 # (defaults to 120 seconds) + + # The modules that run in the 'init' stage + cloud_init_modules: + - migrator + - seed_random + - bootcmd + - write-files + - growpart + - resizefs + - disk_setup + - mounts + - set_hostname + - update_hostname + - update_etc_hosts + - ca-certs + - rsyslog + - users-groups + - ssh + + # The modules that run in the 'config' stage + cloud_config_modules: + - snap + - ssh-import-id + - keyboard + - locale + - set-passwords + - grub-dpkg + - apt-pipelining + - apt-configure + - ubuntu-advantage + - ntp + - timezone + - disable-ec2-metadata + - runcmd + - byobu + + # The modules that run in the 'final' stage + cloud_final_modules: + - package-update-upgrade-install + - fan + - landscape + - lxd + - ubuntu-drivers + - write-files-deferred + - puppet + - chef + - mcollective + - salt-minion + - reset_rmc + - refresh_rmc_and_interface + - rightscale_userdata + - scripts-vendor + - scripts-per-once + - scripts-per-boot + - scripts-per-instance + - scripts-user + - ssh-authkey-fingerprints + - keys-to-console + - install-hotplug + - phone-home + - final-message + - power-state-change + + # System and/or distro specific settings + # (not accessible to handlers/transforms) + system_info: + # This will affect which distro class gets used + distro: ubuntu + # Default user name + that default users groups (if added/used) + default_user: + name: ubuntu + lock_passwd: True + gecos: Ubuntu + groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video] + sudo: ["ALL=(ALL) NOPASSWD:ALL"] + shell: /bin/bash + network: + renderers: ['netplan', 'eni', 'sysconfig'] + # Automatically discover the best ntp_client + ntp_client: auto + # Other config here will be given to the distro class and/or path classes + paths: + cloud_dir: /var/lib/cloud/ + templates_dir: /etc/cloud/templates/ + package_mirrors: + - arches: [i386, amd64] + failsafe: + primary: http://archive.ubuntu.com/ubuntu + security: http://security.ubuntu.com/ubuntu + search: + primary: + - http://%(ec2_region)s.ec2.archive.ubuntu.com/ubuntu/ + - http://%(availability_zone)s.clouds.archive.ubuntu.com/ubuntu/ + - http://%(region)s.clouds.archive.ubuntu.com/ubuntu/ + security: [] + - arches: [arm64, armel, armhf] + failsafe: + primary: http://ports.ubuntu.com/ubuntu-ports + security: http://ports.ubuntu.com/ubuntu-ports + search: + primary: + - http://%(ec2_region)s.ec2.ports.ubuntu.com/ubuntu-ports/ + - http://%(availability_zone)s.clouds.ports.ubuntu.com/ubuntu-ports/ + - http://%(region)s.clouds.ports.ubuntu.com/ubuntu-ports/ + security: [] + - arches: [default] + failsafe: + primary: http://ports.ubuntu.com/ubuntu-ports + security: http://ports.ubuntu.com/ubuntu-ports + ssh_svcname: ssh + + +.. _configuration is templated: https://github.com/canonical/cloud-init/blob/main/config/cloud.cfg.tmpl +.. _cc_final_message.py: https://github.com/canonical/cloud-init/blob/main/cloudinit/config/cc_final_message.py +.. _fileConfig: https://docs.python.org/3/library/logging.config.html#logging-config-fileformat diff --git a/doc/rtd/topics/datasources/exoscale.rst b/doc/rtd/topics/datasources/exoscale.rst index 9074edc6..2d2e4544 100644 --- a/doc/rtd/topics/datasources/exoscale.rst +++ b/doc/rtd/topics/datasources/exoscale.rst @@ -38,8 +38,9 @@ Configuration Users of this datasource are discouraged from changing the default settings unless instructed to by Exoscale support. -The following settings are available and can be set for the datasource in -system configuration (in `/etc/cloud/cloud.cfg.d/`). +The following settings are available and can be set for the +:ref:`datasource base configuration<datasource_base_config>` +(in `/etc/cloud/cloud.cfg.d/`). The settings available are: diff --git a/doc/rtd/topics/datasources/smartos.rst b/doc/rtd/topics/datasources/smartos.rst index 55604ffb..6fe45c73 100644 --- a/doc/rtd/topics/datasources/smartos.rst +++ b/doc/rtd/topics/datasources/smartos.rst @@ -125,7 +125,9 @@ are provided by SmartOS: * user-data * user-script -This list can be changed through system config of variable 'no_base64_decode'. +This list can be changed through +:ref:`datasource base configuration<datasource_base_config>` variable +'no_base64_decode'. This means that user-script and user-data as well as other values can be base64 encoded. Since Cloud-init can only guess as to whether or not something diff --git a/doc/rtd/topics/faq.rst b/doc/rtd/topics/faq.rst index 49399986..8dae49e9 100644 --- a/doc/rtd/topics/faq.rst +++ b/doc/rtd/topics/faq.rst @@ -47,6 +47,9 @@ Cloud-init config is provided in two places: These files can define the modules that run during instance initialization, the datasources to evaluate on boot, and other settings. +See the :ref:`configuration sources explanation<configuration>` and +:ref:`configuration reference<base_config_reference>` for more information. + Where are the data files? ========================= diff --git a/doc/rtd/topics/instancedata.rst b/doc/rtd/topics/instancedata.rst index a5b297e1..575dbf1b 100644 --- a/doc/rtd/topics/instancedata.rst +++ b/doc/rtd/topics/instancedata.rst @@ -181,10 +181,10 @@ Top-level keys: 'security sensitive'. Only the keys listed here will be redacted from instance-data.json for non-root users. -* **merged_cfg**: Merged cloud-init 'system_config' from `/etc/cloud/cloud.cfg` - and `/etc/cloud/cloud-cfg.d`. Values under this key could contain sensitive - information such as passwords, so it is included in the **sensitive-keys** - list which is only readable by root. +* **merged_cfg**: Merged cloud-init :ref:`base_config_reference` from + `/etc/cloud/cloud.cfg` and `/etc/cloud/cloud-cfg.d`. Values under this key + could contain sensitive information such as passwords, so it is included in + the **sensitive-keys** list which is only readable by root. * **ds**: Datasource-specific metadata crawled for the specific cloud platform. It should closely represent the structure of the cloud metadata @@ -375,7 +375,7 @@ EC2 instance: "availability_zone": "us-east-1b", "base64_encoded_keys": [], "merged_cfg": { - "_doc": "Merged cloud-init system config from /etc/cloud/cloud.cfg and /etc/cloud/cloud.cfg.d/", + "_doc": "Merged cloud-init base config from /etc/cloud/cloud.cfg and /etc/cloud/cloud.cfg.d/", "_log": [ "[loggers]\nkeys=root,cloudinit\n\n[handlers]\nkeys=consoleHandler,cloudLogHandler\n\n[formatters]\nkeys=simpleFormatter,arg0Formatter\n\n[logger_root]\nlevel=DEBUG\nhandlers=consoleHandler,cloudLogHandler\n\n[logger_cloudinit]\nlevel=DEBUG\nqualname=cloudinit\nhandlers=\npropagate=1\n\n[handler_consoleHandler]\nclass=StreamHandler\nlevel=WARNING\nformatter=arg0Formatter\nargs=(sys.stderr,)\n\n[formatter_arg0Formatter]\nformat=%(asctime)s - %(filename)s[%(levelname)s]: %(message)s\n\n[formatter_simpleFormatter]\nformat=[CLOUDINIT] %(filename)s[%(levelname)s]: %(message)s\n", "[handler_cloudLogHandler]\nclass=FileHandler\nlevel=DEBUG\nformatter=arg0Formatter\nargs=('/var/log/cloud-init.log',)\n", diff --git a/doc/rtd/topics/logging.rst b/doc/rtd/topics/logging.rst index f72b77c1..4d0a14ca 100644 --- a/doc/rtd/topics/logging.rst +++ b/doc/rtd/topics/logging.rst @@ -1,3 +1,5 @@ +.. _logging: + ******* Logging ******* @@ -98,8 +100,10 @@ the default format string ``%(message)s``:: For additional information about configuring python's logging module, please see the documentation for `python logging config`_. +.. _logging_command_output: + Command Output --------------- +============== Cloud-init can redirect its stdout and stderr based on config given under the ``output`` config key. The output of any commands run by cloud-init and any user or vendor scripts provided will also be included here. The ``output`` key diff --git a/doc/rtd/topics/module_creation.rst b/doc/rtd/topics/module_creation.rst index c0bf4003..56cadec4 100644 --- a/doc/rtd/topics/module_creation.rst +++ b/doc/rtd/topics/module_creation.rst @@ -66,7 +66,9 @@ Guidelines instance types. * ``log``: A logger object that can be used to log messages. * ``args``: An argument list. This is usually empty and is only populated - if the module is called independently from the command line. + if the module is called independently from the command line or if the + module definition in ``/etc/cloud/cloud.cfg[.d]`` has been modified + to pass arguments to this module. * If your module introduces any new cloud-config keys, you must provide a schema definition in `cloud-init-schema.json`_. diff --git a/doc/rtd/topics/network-config-format-v1.rst b/doc/rtd/topics/network-config-format-v1.rst index 68a9cefa..a9dd31af 100644 --- a/doc/rtd/topics/network-config-format-v1.rst +++ b/doc/rtd/topics/network-config-format-v1.rst @@ -10,7 +10,8 @@ creation (bonds, bridges, vlans) routes and DNS configuration. Required elements of a Network Config Version 1 are ``config`` and ``version``. -Cloud-init will read this format from system config. +Cloud-init will read this format from :ref:`base_config_reference`. + For example the following could be present in ``/etc/cloud/cloud.cfg.d/custom-networking.cfg``: diff --git a/doc/rtd/topics/network-config-format-v2.rst b/doc/rtd/topics/network-config-format-v2.rst index 952d15ae..53274417 100644 --- a/doc/rtd/topics/network-config-format-v2.rst +++ b/doc/rtd/topics/network-config-format-v2.rst @@ -30,7 +30,8 @@ The ``network`` key has at least two required elements. First it must include ``version: 2`` and one or more of possible device ``types``. -Cloud-init will read this format from system config. +Cloud-init will read this format from :ref:`base_config_reference`. + For example the following could be present in ``/etc/cloud/cloud.cfg.d/custom-networking.cfg``:: diff --git a/doc/rtd/topics/network-config.rst b/doc/rtd/topics/network-config.rst index 3e48555f..b6d7a9be 100644 --- a/doc/rtd/topics/network-config.rst +++ b/doc/rtd/topics/network-config.rst @@ -1,3 +1,5 @@ +.. _network_config: + ********************* Network Configuration ********************* diff --git a/tests/unittests/config/test_schema.py b/tests/unittests/config/test_schema.py index a401ffd4..50128f2c 100644 --- a/tests/unittests/config/test_schema.py +++ b/tests/unittests/config/test_schema.py @@ -165,6 +165,7 @@ class TestGetSchema: assert ["$defs", "$schema", "allOf"] == sorted(list(schema.keys())) # New style schema should be defined in static schema file in $defs expected_subschema_defs = [ + {"$ref": "#/$defs/base_config"}, {"$ref": "#/$defs/cc_ansible"}, {"$ref": "#/$defs/cc_apk_configure"}, {"$ref": "#/$defs/cc_apt_configure"}, |