Files
micro-config-drive/docs/cloud-config.5
T
Auke Kok 9644cbdc5d Add wait_for_network: <boolean>.
This option allows users to suspend execution of the cloud-init provisioning
until a valid network is detected.

This detection is currently done through requesting a DNS lookup for one
of the Clear Linux NTP service IP addresses (this is a RR record, we
don't actually look at the result).

This lookup is not infinite. After 5 minutes, the wait exits no matter
what even if there is no network detected.

The option can be provided manually. `packages` and `package_upgrade`
options *imply* this option, but one can explicitly disable the wait
by providing it early in the cloud-config file with a value of `false`.

The wait routing is active - it will retry relatively quickly to detect
an active connection. Any failure will result in another retry. In
a fully private network without public DNS, this will not work.

The DNS hostname used for testing can be manipulated through the
`-with-dnstestaddr=<hostname>` configure flag. You shouldn't put an
IP address in here, since that fully disables any network testing.
2019-10-29 11:33:17 -07:00

275 lines
11 KiB
Plaintext

.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "CLOUD\-CONFIG" "5" "October 2019" "" ""
.
.SH "NAME"
\fBcloud\-config\fR \- User data format used by \fBucd(1)\fR
.
.SH "SYNOPSIS"
\fBuser\-data\fR
.
.P
\fB#cloud\-config\fR
.
.P
cloud\-config data is provided by the cloud infrastructure to a cloud instance\. This data is parsed by \fBcloud\-init(1)\fR which then configures the cloud instance based on the information in the cloud\-config\.
.
.SH "DESCRIPTION"
The user\-data as provided can be of several formats\. \fBcloud\-init(1)\fR supports the \fBcloud\-config\fR format, but also supports generic shell scripts\. If the user\-data starts with \fB#!\fR, it is assumed that the user\-data is a generic shell script, and \fBcloud\-init\fR will attempt to execute the data as a script\. If the user\-data starts with the \fB#cloud\-config\fR stanza, it is assumed the user\-data is in the \fBcloud\-config\fR format, described below\.
.
.P
The \fBcloud\-config\fR format is used to structure configuration data provided to the cloud instance\. This data is structured in the YAML format (\fBhttp://yaml\.org\fR)\. Note that \fBcloud\-init\fR(1) uses the libyaml library, which supports YAML version 1\.1\.
.
.P
In the YAML content, the root node (the document) contains a sequence of directives\. These directives inform cloud\-init that the content of the directive are processed by a directive\-specific handler, or "module"\.
.
.P
cloud\-init includes many modules, each expecting a specifically constructed content\. This document lists the correct format and organization of each data section for the supported modules, describes their effect, and states various parameters for each option\.
.
.P
Table of implemented directives\. Column 3 ("Ref") and column 4 ("CoreOS") list whether the reference specification or the CoreOS implementation support these directives\. Note that implementation details may differ, due to the underlying differences in Operating Systems\.
.
.IP "" 4
.
.nf
Directive |Description |Ref\. |CoreOS\.
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-|\-\-\-\-\-\-\-
groups |Configure user account groups |yes |no
package_upgrade |Perform a software update |yes |no
packages |Install additional software |yes |no
runcmd |Execute system commands |yes |no
service |Perform system service configuration |no |no
ssh_authorized_keys |Provision SSH public keys |yes |yes
users |Configure user accounts |yes |yes
write_files |Write content to arbitrary files |yes |yes
hostname |Define the system\'s hostname |yes |yes
envar |Set environment variables |no |no
bootcmd |Execute system commands on first boot|no |no
wait_for_network |Halt execution until network is up |no |no
.
.fi
.
.IP "" 0
.
.SH "OPTIONS"
For each of the directives listed in the table above, zero or more options may be provided\. The list below documents the implemented options per directive\. The "Type" field values are:
.
.SS "TYPES"
.
.nf
Type |Description
\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
boolean |Either true, false, yes, no, 0 or 1 (upper case and initial capitol
|letter versions treated identical)
string |A generic string encoded value\. Can be multiline or YAML encoded
|content
integer |A string encoded decimal integer value
octal |A string encoded octal integer value
hex |A string encoded hexadecimal integer value
[] |if a type is listed with [] appended, it means there may be zero or
|more values, lists of values or any arbitrary depth of these nested
* |Indicates this value isn\'t a separate key, but directly the
|associated value of the root node\. This is applicable for directives
|that only have a single configuration parameter,
|e\.g\. "package_upgrade"
.
.fi
.
.SS "groups"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
name |string[] |no |Create a new user account group and
| | |place listed user account names in
| | |that group
.
.fi
.
.SS "package_upgrade"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
* |boolean |yes |Enables or disables whether software
| | |update is performed
.
.fi
.
.P
This option implies the \fBwait_for_network\fR option\.
.
.SS "packages"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
name |string[] |no |Enables installation of software bundles
.
.fi
.
.P
This option implies the \fBwait_for_network\fR option\.
.
.SS "runcmd"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
* |string[] |no |Executes a command, if the item is a list,
| | |the list will be converted to a string
| | |and executed as a command line\.
.
.fi
.
.SS "hostname"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
* |string |yes |Defines the system\'s hostname
.
.fi
.
.SS "service"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
start |string[] |no |Start units
stop |string[] |no |Stop units
restart |string[] |no |Restart units
enable |string[] |no |Enable units to start automatically
disable |string[] |no |Disable units from starting automatically
reload |string[] |no |Reload service units
isolate |string[] |no |Change target to a new unit
mask |string[] |no |Prevent units from starting
unmask |string[] |no |Remove unit start prevention mask
.
.fi
.
.SS "ssh_authorized_keys"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
* |string[] |no |Specifies an SSH public key value, as
| | |string\. This will be added to the default
| | |user account\'s SSH configuration
.
.fi
.
.SS "users"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
* |[] |no |This directive expects a list of user
| | |definitions\. Each definition can
| | |additionally specify the following
| | |sub\-options:
name |string |yes |A user account name to be created
gecos |string |no |A real user name, can be left empty
homedir |string |no |A home directory path\. Default under "/home"
primary\-group|string|no |A group name\.
groups |string |no |Comma\-separated list of group names or
| | |single group name\. Specifies additional
| | |groups to put this user account into
lock\-passwd|boolean |no |Lock the user account
inactive |boolean |no |Mark the user account as inactive
passwd |string |no |Password hash for the user account
no\-create\-home|boolean|no |Omits creating a home directory
no\-user\-group|boolean|no |Omits group creating for the account
no\-log\-init|boolean |no |Omits this account from lastlog/faillog
expiredate|string |no |A date at which to expire the password
ssh\-authorized\-keys|string[]|no |Add SSH public keys to ssh configuration
sudo |string[] |no |Add sudoers lines for this account, the account
| | |name is automatically prepended
system |boolean |no |Make the account a system account
.
.fi
.
.SS "write_files"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
* |[] |no |This directive expects a list of write_files
| | |definitions\. Each definition itself contains the
| | |following options:
content |string |yes |The content to write to a file
path |string |yes |The full path and filename of the file to
| | |be written out
owner |string |no |Username and optionally group name, separated
| | |by ":" or "\."\. Defaults to "root\.root"
permissions|octal |no |Octal value describing the file permissions
| | |default value is influenced according to
| | |`umask`
.
.fi
.
.SS "envar"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
* |string |yes |Add environment variables to /etc/profile\.d/cloud\-init\.sh
| | |and to current cloud\-init process
.
.fi
.
.SS "bootcmd"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
* |string[] |no |Similar to runcmd but bootcmd will run only on first boot
.
.fi
.
.SS "wait_for_network"
.
.nf
Option |Type |Required |Function
\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
* |boolean |no |Enable to force waiting for a functional network\.
.
.fi
.
.P
This option makes the program wait until an active network is detected\. To prevent waiting, ensure that this option is disabled explicitly disabled, before other options are used\. This may be needed when using the \fBpackages\fR or \fBpackage_upgrade\fR options, which imply that this option is used\.
.
.SH "COPYRIGHT"
.
.IP "\(bu" 4
Copyright (C) 2017 Intel Corporation, License: CC\-BY\-SA\-3\.0
.
.IP "" 0
.
.SH "SEE ALSO"
\fBcloud\-init\fR(1)
.
.SH "NOTES"
Creative Commons Attribution\-ShareAlike 3\.0 Unported
.
.IP "\(bu" 4
http://creativecommons\.org/licenses/by\-sa/3\.0/
.
.IP "" 0