* providers: ignition, basic config, version and config * providers: ignition, user and passwd example, general cache implementation * vendor: Capture new dependency upstream-pkg * providers: ignition ignition_user * providers: ignition ignition_disk, ignition_group and ignition_raid * providers: ignition_file and ignition_filesystem * providers: ignition_systemd_unit and ignition_networkd_unit * providers: ignition_config improvements * vendor: Capture new dependency upstream-pkg * providers: ignition main * documentation: ignition provider * providers: ignition minor changes * providers: ignition, fix test * fixing tests and latest versions
2.1 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| ignition | Ignition: ignition_file | docs-ignition-resource-file | Describes a file to be written in a particular filesystem. |
ignition_file
Describes a file to be written in a particular filesystem.
Example Usage
File with inline content:
resource "ignition_file" "hello" {
filesystem = "foo"
path = "/hello.txt"
content {
content = "Hello World!"
}
}
File with remote content:
resource "ignition_file" "hello" {
filesystem = "qux"
path = "/hello.txt"
source {
source = "http://example.com/hello.txt.gz"
compression = "gzip"
verification = "sha512-0123456789abcdef0123456789...456789abcdef"
}
}
Argument Reference
The following arguments are supported:
-
filesystem- (Optional) The internal identifier of the filesystem. This matches the last filesystem with the given identifier. This should be a valid name from a ignition_filesystem resource. -
path- (Optional) The absolute path to the file. -
content- (Optional) Block to provide the file content inline. -
source- (Optional) Block to retrieve the file content from a remote location.Note:
contentandsourceare mutually exclusive -
mode- (Optional) The list of partitions and their configuration for this particular disk.. -
uid- (Optional) The user ID of the owner. -
gid- (Optional) The group ID of the owner.
The content block supports:
-
mime- (Required) MIME format of the content (default text/plain). -
content- (Required) Content of the file.
The source block supports:
-
source- (Required) The URL of the file contents. When using http, it is advisable to use the verification option to ensure the contents haven’t been modified. -
compression- (Optional) The type of compression used on the contents (null or gzip). -
verification- (Optional) The hash of the config, in the form <type>-<value> where type is sha512.
Attributes Reference
The following attributes are exported:
id- ID used to reference this resource in ignition_config.