besides document that vyos_config_commands will do commit and save fixed 80 line len for linter

This commit is contained in:
Roberto Bertó 2024-03-17 14:08:57 -03:00 committed by GitHub
parent f08a70b59b
commit b82255f407
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,8 +8,8 @@ VyOS cloud-init
Cloud and virtualized instances of VyOS are initialized using the Cloud and virtualized instances of VyOS are initialized using the
industry-standard cloud-init. Via cloud-init, the system performs tasks such as industry-standard cloud-init. Via cloud-init, the system performs tasks such as
injecting SSH keys and configuring the network. In addition, the user can supply injecting SSH keys and configuring the network. In addition, the user can
a custom configuration at the time of instance launch. supply a custom configuration at the time of instance launch.
************** **************
Config Sources Config Sources
@ -25,9 +25,9 @@ VyOS support three types of config sources.
network settings like IP addresses, routes, DNS. Available only in several network settings like IP addresses, routes, DNS. Available only in several
cloud and virtualization platforms. cloud and virtualization platforms.
* User-data - User-data is specified by the user. This config source offers the * User-data - User-data is specified by the user. This config source offers
ability to insert any CLI configuration commands into the configuration before the ability to insert any CLI configuration commands into the configuration
the first boot. before the first boot.
********* *********
User-data User-data
@ -39,8 +39,8 @@ depending on cloud provider. Also, it can be compressed using gzip, which makes
sense with a long configuration commands list, because of the hard limit to sense with a long configuration commands list, because of the hard limit to
~16384 bytes for the whole user-data. ~16384 bytes for the whole user-data.
The easiest way to configure the system via user-data is the Cloud-config syntax The easiest way to configure the system via user-data is the Cloud-config
described below. syntax described below.
******************** ********************
Cloud-config modules Cloud-config modules
@ -50,11 +50,12 @@ In VyOS, by default, enables only two modules:
* ``write_files`` - this module allows to insert any files into the filesystem * ``write_files`` - this module allows to insert any files into the filesystem
before the first boot, for example, pre-generated encryption keys, before the first boot, for example, pre-generated encryption keys,
certificates, or even a whole ``config.boot`` file. The format is described in the cloudinit documentation `Cloud-init-write_files`_. certificates, or even a whole ``config.boot`` file. The format is described
in the cloudinit documentation `Cloud-init-write_files`_.
* ``vyos_userdata`` - the module accepts a list of CLI configuration commands in * ``vyos_userdata`` - the module accepts a list of CLI configuration commands
a ``vyos_config_commands`` section, which gives an easy way to configure the in a ``vyos_config_commands`` section, which gives an easy way to configure
system during deployment. the system during deployment.
************************ ************************
cloud-config file format cloud-config file format
@ -62,8 +63,8 @@ cloud-config file format
A cloud-config document is written in YAML. The file must begin A cloud-config document is written in YAML. The file must begin
with ``#cloud-config`` line. The only supported top-level keys are with ``#cloud-config`` line. The only supported top-level keys are
``vyos_config_commands`` and ``write_files``. The use of these keys is described ``vyos_config_commands`` and ``write_files``. The use of these keys is
in the following two sections. described in the following two sections.
************************ ************************
@ -81,15 +82,15 @@ Commands requirements:
* If command ends in a value, it must be inside single quotes. * If command ends in a value, it must be inside single quotes.
* A single-quote symbol is not allowed inside command or value. * A single-quote symbol is not allowed inside command or value.
The commands list produced by the ``show configuration commands`` command on a The commands list produced by the ``show configuration commands`` command
VyOS router should comply with all the requirements, so it is easy to get a on a VyOS router should comply with all the requirements, so it is easy
proper commands list by copying it from another router. to get a proper commands list by copying it from another router.
The configuration specified in the cloud-config document overwrites default The configuration specified in the cloud-config document overwrites default
configuration values and values configured via Metadata. configuration values and values configured via Metadata.
After the ``vyos_config_commands`` are executed, cloud-init will automatically After the ``vyos_config_commands`` are executed, cloud-init will
perform a ``commit`` and ``save`` operation. automatically perform a ``commit`` and ``save`` operation.
Here is an example cloud-config that appends configuration at the time of Here is an example cloud-config that appends configuration at the time of
first boot. first boot.
@ -230,8 +231,8 @@ valid YAML. Online resources such as https://www.yamllint.com/ provide
a simple tool for validating YAML. a simple tool for validating YAML.
cloud-init logs to /var/log/cloud-init.log. This file can be helpful in cloud-init logs to /var/log/cloud-init.log. This file can be helpful in
determining why the configuration varies from what you expect. You can fetch the determining why the configuration varies from what you expect. You can fetch
most important data filtering output for ``vyos`` keyword: the most important data filtering output for ``vyos`` keyword:
.. code-block:: none .. code-block:: none