### Start a systemd Service Source: https://coreos.github.io/ignition/examples This example configures a systemd service named 'example.service'. The service is enabled to start on boot as a dependency of multi-user.target and executes an echo command. The configuration is written in JSON format for Ignition. ```json { "ignition": { "version": "3.0.0" }, "systemd": { "units": [{ "name": "example.service", "enabled": true, "contents": "[Service]\nType=oneshot\nExecStart=/usr/bin/echo Hello World\n\n[Install]\nWantedBy=multi-user.target" }] } } ``` -------------------------------- ### systemd Service Unit File Source: https://coreos.github.io/ignition/examples This is the content of the 'example.service' unit file, which is a simple oneshot service that echoes 'Hello World'. It's configured to be wanted by 'multi-user.target', ensuring it starts on boot. ```systemd [Service] Type=oneshot ExecStart=/usr/bin/echo Hello World [Install] WantedBy=multi-user.target ``` -------------------------------- ### Set Kernel Arguments Source: https://coreos.github.io/ignition/examples Configures kernel arguments, ensuring 'example' and 'foo bar' exist and 'somekarg' does not. ```json { "ignition": {"version": "3.3.0"}, "kernelArguments": { "shouldExist": ["example", "foo bar"], "shouldNotExist": ["somekarg"] } } ``` -------------------------------- ### Create File on Root Filesystem Source: https://coreos.github.io/ignition/examples This Ignition configuration creates a file named '/etc/someconfig' on the root filesystem. The file's content is 'example file' and is specified using a data URL. The file is created with read/write permissions for the owner. ```json { "ignition": { "version": "3.0.0" }, "storage": { "files": [{ "path": "/etc/someconfig", "mode": 420, "contents": { "source": "data:,example%20file%0A" } }] } } ``` -------------------------------- ### Update Documentation and Examples Source: https://coreos.github.io/ignition/release-notes The documentation has been updated with cleaned-up examples and a list of supported platforms. This aims to improve the clarity and usability of Ignition's documentation. -------------------------------- ### Add Guides and Update Config Spec Source: https://coreos.github.io/ignition/release-notes New guides have been added, and the configuration specification has been updated. This provides users with more comprehensive documentation and a clearer understanding of Ignition's capabilities. -------------------------------- ### Example of Fetching and Writing a File with Ignition Source: https://coreos.github.io/ignition/rationale This example demonstrates how Ignition can fetch a configuration file from a URL and write it to the machine's disk. If Ignition fails to resolve the URL or write the file, it will prevent the machine from booting, ensuring the specified state is met. ```json { "ignition": { "version": "3.2.0" }, "files": [ { "path": "/etc/foo.conf", "contents": { "source": "https://example.com/foo.conf" } } ] } ``` -------------------------------- ### Create LUKS Volume and Mount Source: https://coreos.github.io/ignition/examples Sets up a key-file based LUKS2 volume named 'data' on /dev/sdb, creates an ext4 filesystem with the label 'DATA' on it, and configures a systemd mount unit for /var/lib/data. ```json { "ignition": {"version": "3.2.0"}, "storage": { "luks": [{ "name": "data", "device": "/dev/sdb" }], "filesystems": [{ "path": "/var/lib/data", "device": "/dev/disk/by-id/dm-name-data", "format": "ext4", "label": "DATA" }] }, "systemd": { "units": [{ "name": "var-lib-data.mount", "enabled": true, "contents": "[Mount]\nWhat=/dev/disk/by-label/DATA\nWhere=/var/lib/data\nType=ext4\n\n[Install]\nWantedBy=local-fs.target" }] } } ``` -------------------------------- ### Calculate SHA256 Sum Source: https://coreos.github.io/ignition/examples Example command to calculate the SHA256 sum of a file, also usable for verifying remote Ignition configuration contents. ```bash sha256sum ``` -------------------------------- ### Configure Partitions in Ignition Source: https://coreos.github.io/ignition/configuration-v3_0 Describes how to manage disk partitions, including whether a partition should exist, its number, label, size, GUID, and type GUID. ```JSON { "partitions": [ { "number": 1, "shouldExist": true, "label": "BOOT", "start": "2048s", "size": "512MiB", "guid": "f8f7e6d5-c4b3-a291-0000-000000000000", "typeGuid": "0FC63DAF-8483-4772-9660-7082370A3030" }, { "number": 2, "shouldExist": false, "wipePartitionEntry": true } ] } ``` -------------------------------- ### Configure Disk Partitioning Source: https://coreos.github.io/ignition/configuration-v3_4 Specifies the desired state of storage disks, including wiping partition tables and defining partitions. Each partition can be configured with a number, label, size, start position, type GUID, and unique GUID. Options for resizing and handling existing partitions are also available. ```json { "storage": { "disks": [ { "device": "/dev/vda", "wipeTable": true, "partitions": [ { "number": 1, "sizeMiB": 1024, "label": "boot", "typeGuid": "21686148-6449-6E6F-746F-69676E6F7465" }, { "number": 2, "sizeMiB": 0, "label": "root", "guid": "f8071071-1071-4071-8071-071071071071" } ] } ] } } ``` -------------------------------- ### Configure Disk Partitioning Source: https://coreos.github.io/ignition/configuration-v3_3 Specifies the desired state of storage disks, including wiping partition tables and defining partitions. Each partition can be configured with a number, label, size, start position, type GUID, and unique GUID. Options for resizing and handling existing partitions are also available. ```json { "storage": { "disks": [ { "device": "/dev/vda", "wipeTable": true, "partitions": [ { "number": 1, "sizeMiB": 1024, "label": "boot", "typeGuid": "21686148-6449-6E6F-746F-69676E6F7465" }, { "number": 2, "sizeMiB": 0, "label": "root", "guid": "f8071071-1071-4071-8071-071071071071" } ] } ] } } ``` -------------------------------- ### Calculate SHA512 Sum Source: https://coreos.github.io/ignition/examples Example command to calculate the SHA512 sum of a file, used for verifying remote Ignition configuration contents. ```bash sha512sum ``` -------------------------------- ### Install GRUB for bootupd Source: https://coreos.github.io/ignition/release-notes Installs a GRUB configuration suitable for use with the coreos/bootupd project. This is a specific build-time operation. ```bash make install-grub-for-bootupd ``` -------------------------------- ### Reformat /var Filesystem and Create File Source: https://coreos.github.io/ignition/examples This Ignition configuration reformats the device labeled 'VAR' to Btrfs, sets the filesystem label to 'VAR', and wipes any existing filesystem. It also creates a file '/var/example-asset' by fetching its content from a URL and includes a SHA512 verification hash. Ignition mounts the filesystem at '/var' before creating the file. ```json { "ignition": { "version": "3.0.0" }, "storage": { "filesystems": [{ "device": "/dev/disk/by-label/VAR", "path": "/var", "format": "btrfs", "wipeFilesystem": true, "label": "VAR" }], "files": [{ "path": "/var/example-asset", "mode": 420, "contents": { "source": "http://example.com/asset", "verification": { "hash": "sha512-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" } } }] } } ``` -------------------------------- ### Configure Disk Partitioning Source: https://coreos.github.io/ignition/configuration-v3_5 Specifies the desired state of storage disks, including wiping partition tables and defining partitions. Each partition can be configured with a number, label, size, start position, type GUID, and unique GUID. Options for resizing and handling existing partitions are also available. ```json { "storage": { "disks": [ { "device": "/dev/vda", "wipeTable": true, "partitions": [ { "number": 1, "sizeMiB": 1024, "label": "boot", "typeGuid": "21686148-6449-6E6F-746F-69676E6F7465" }, { "number": 2, "sizeMiB": 0, "label": "root", "guid": "f8071071-1071-4071-8071-071071071071" } ] } ] } } ``` -------------------------------- ### Set System Hostname Source: https://coreos.github.io/ignition/examples Configures the system's hostname by writing 'core1' to the /etc/hostname file. ```json { "ignition": { "version": "3.0.0" }, "storage": { "files": [{ "path": "/etc/hostname", "mode": 420, "overwrite": true, "contents": { "source": "data:,core1" } }] } } ``` -------------------------------- ### Replace Ignition Config with Remote Config Source: https://coreos.github.io/ignition/examples Demonstrates how to replace the current Ignition config with a remote one, using a SHA512 hash for verification to overcome size limits in some cloud environments. ```json { "ignition": { "version": "3.0.0", "config": { "replace": { "source": "http://example.com/config.json", "verification": { "hash": "sha512-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" } } } } } ``` -------------------------------- ### Create RAID-enabled Data Volume Source: https://coreos.github.io/ignition/examples Configures a RAID0 ext4 volume named 'data' across two disks (/dev/sdb and /dev/sdc) and sets up a systemd mount unit to automatically mount it to /var/lib/data. ```json { "ignition": { "version": "3.0.0" }, "storage": { "disks": [ { "device": "/dev/sdb", "wipeTable": true, "partitions": [{ "label": "raid.1.1", "number": 1, "sizeMiB": 1024, "startMiB": 0 }] }, { "device": "/dev/sdc", "wipeTable": true, "partitions": [{ "label": "raid.1.2", "number": 1, "sizeMiB": 1024, "startMiB": 0 }] } ], "raid": [{ "devices": [ "/dev/disk/by-partlabel/raid.1.1", "/dev/disk/by-partlabel/raid.1.2" ], "level": "stripe", "name": "data" }], "filesystems": [{ "device": "/dev/md/data", "path": "/var/lib/data", "format": "ext4", "label": "DATA" }] }, "systemd": { "units": [{ "name": "var-lib-data.mount", "enabled": true, "contents": "[Mount]\nWhat=/dev/md/data\nWhere=/var/lib/data\nType=ext4\n\n[Install]\nWantedBy=local-fs.target" }] } } ``` -------------------------------- ### Ignition Kernel Arguments Helper Binary Source: https://coreos.github.io/ignition/distributor-notes This Go code snippet demonstrates an example implementation for the Ignition kargs helper binary. It shows how to handle `--should-exist` and `--should-not-exist` parameters for managing kernel arguments and includes logic for rebooting the system if necessary. ```Go package main import ( "flag" "fmt" "os" "os/exec" "strings" ) func main() { shouldExist := flag.Bool("should-exist", false, "Ensure the argument exists") shouldNotExist := flag.Bool("should-not-exist", false, "Ensure the argument does not exist") flag.Parse() if len(flag.Args()) == 0 { fmt.Fprintf(os.Stderr, "Usage: %s [options] \n", os.Args[0]) os.Exit(1) } kernelArg := flag.Arg(0) if *shouldExist { fmt.Printf("Ensuring kernel argument '%s' exists.\n", kernelArg) // Logic to check if kernelArg is present and append if not // For demonstration, we'll just print a message fmt.Printf("Would append '%s' if missing.\n", kernelArg) // In a real implementation, you would modify /proc/cmdline or equivalent } else if *shouldNotExist { fmt.Printf("Ensuring kernel argument '%s' does not exist.\n", kernelArg) // Logic to check if kernelArg is present and remove if it is // For demonstration, we'll just print a message fmt.Printf("Would remove '%s' if present.\n", kernelArg) // In a real implementation, you would modify /proc/cmdline or equivalent } // Example of checking if a reboot is necessary (simplified) if strings.Contains(kernelArg, "reboot=force") { fmt.Println("Reboot is necessary.") // In a real scenario, you would trigger a reboot here // cmd := exec.Command("systemctl", "reboot") // cmd.Run() } } // Example of how to call this binary from Ignition config: // "kargsCmd": "/path/to/ignition-kargs-helper" // "args": ["--should-exist", "root=/dev/vda1"] // or // "args": ["--should-not-exist", "quiet"] ``` -------------------------------- ### Configure Disk Partitioning Source: https://coreos.github.io/ignition/configuration-v3_1 Specifies the desired state of storage disks, including wiping partition tables and defining individual partitions with their properties like size, type, and GUID. ```json { "storage": { "disks": [ { "device": "/dev/vda", "wipeTable": true, "partitions": [ { "label": "BOOT", "number": 1, "sizeMiB": 512, "typeGuid": "C129701F-85C5-4265-873C-E6364C23A790" }, { "label": "ROOT", "number": 2, "sizeMiB": 0, "startMiB": 512, "typeGuid": "0FC63DAF-8483-4772-8E79-3D69D8477DE4", "guid": "A1B2C3D4-E5F6-7890-1234-567890ABCDEF" } ] } ] } } ``` -------------------------------- ### Install libblkid-dev on Debian/Ubuntu Source: https://coreos.github.io/ignition/development Installs the necessary libblkid-dev package on Debian or Ubuntu systems, which is a dependency for building Ignition. ```Shell sudo apt-get install libblkid-dev ``` -------------------------------- ### systemd Drop-in Configuration for Logging Source: https://coreos.github.io/ignition/examples This file represents a drop-in configuration for 'systemd-journald.service'. It modifies the service's environment to set 'SYSTEMD_LOG_LEVEL' to 'debug', enabling more verbose logging. ```systemd [Service] Environment=SYSTEMD_LOG_LEVEL=debug ``` -------------------------------- ### Ignition Configuration Merging with Verification Source: https://coreos.github.io/ignition/configuration-v3_6_experimental This example demonstrates how to configure Ignition to merge an external configuration file. It specifies the source URL, optional compression, HTTP headers for the request, and a hash for verifying the integrity of the decompressed configuration. ```JSON { "ignition": { "version": "3.6.0-experimental", "config": { "merge": [ { "source": "https://example.com/config.ign", "compression": "gzip", "httpHeaders": [ { "name": "X-Auth-Token", "value": "your-token" } ], "verification": { "hash": "sha512-abcdef123456..." } } ] } } } ``` -------------------------------- ### Add Users with SSH Keys Source: https://coreos.github.io/ignition/examples Adds two users, 'systemUser' and 'jenkins'. 'systemUser' is configured with a password hash and an SSH public key, while 'jenkins' is assigned a UID of 1000. ```json { "ignition": { "version": "3.0.0" }, "passwd": { "users": [ { "name": "systemUser", "passwordHash": "$superSecretPasswordHash.", "sshAuthorizedKeys": [ "ssh-rsa veryLongRSAPublicKey" ] }, { "name": "jenkins", "uid": 1000 } ] } } ``` -------------------------------- ### Configure Disk and Partitions Source: https://coreos.github.io/ignition/configuration-v3_6_experimental Specifies the desired state of storage devices, including wiping partition tables and defining individual partitions with properties like size, label, GUID, and existence. Partitions can be identified by number or label, and their entries can be wiped if they don't match the configuration. ```json { "storage": { "disks": [ { "device": "/dev/vda", "wipeTable": true, "partitions": [ { "number": 1, "label": "boot", "sizeMiB": 512, "typeGuid": "C1297012-F81F-479E-A780-8002F00B0A5A" }, { "number": 2, "label": "root", "sizeMiB": 0, "startMiB": 512, "wipePartitionEntry": true, "shouldExist": true, "resize": true } ] } ] } } ``` -------------------------------- ### Install schematyper for Go Struct Generation Source: https://coreos.github.io/ignition/development Installs the schematyper tool, which is used to generate Go structs from JSON schema definitions. This is a prerequisite for modifying the Ignition config spec. ```Go go get -u github.com/idubinskiy/schematyper ``` -------------------------------- ### Improve Validation of Storage Options Source: https://coreos.github.io/ignition/release-notes The validation logic for `storage.filesystems` options has been enhanced. This ensures that storage configurations are more robustly checked, preventing potential errors during disk setup. -------------------------------- ### Remove dependency on `kpartx` for blackbox tests Source: https://coreos.github.io/ignition/release-notes Eliminates the requirement for the `kpartx` utility in blackbox tests. This simplifies test setup and reduces external dependencies. ```Go // No specific code snippet provided for this change, but it implies test environment modifications. ``` -------------------------------- ### Update JSON Configuration Keys Source: https://coreos.github.io/ignition/release-notes JSON configuration keys have been updated to match the established style guide. This ensures consistency in configuration file formats. -------------------------------- ### Ignition Configuration: Storage - Disk Partitioning Source: https://coreos.github.io/ignition/configuration-v3_0 Defines the desired state of storage devices, specifically focusing on disk partitioning. This includes options for wiping partition tables, defining partitions with labels, numbers, sizes, start positions, and GUIDs. ```JSON { "storage": { "disks": [ { "device": "/dev/vda", "wipeTable": true, "partitions": [ { "label": "ROOT", "number": 1, "sizeMiB": 1024, "startMiB": 0, "typeGuid": "0FC63DAF-8483-4772-8E79-3D69D8477DE4", "guid": "", "wipePartitionEntry": false } ] } ] } } ``` -------------------------------- ### Configure Filesystems Source: https://coreos.github.io/ignition/configuration-v3_6_experimental Sets up filesystems on storage devices, specifying the device, format type (e.g., ext4, xfs, btrfs, vfat, swap, none), mount point, and optional parameters like filesystem label, UUID, mount options, and whether to wipe the existing filesystem. ```json { "storage": { "filesystems": [ { "device": "/dev/vda2", "format": "ext4", "path": "/", "wipeFilesystem": true, "label": "rootfs", "mountOptions": [ "defaults", "rw" ] }, { "device": "/dev/vda1", "format": "vfat", "path": "/boot", "label": "bootfs" } ] } } ``` -------------------------------- ### Configure Filesystem Source: https://coreos.github.io/ignition/configuration-v3_1 Sets up filesystems on storage devices, specifying the device, format type, mount point, and optional parameters like labels, UUIDs, and mount options. ```json { "storage": { "filesystems": [ { "device": "/dev/vda2", "format": "ext4", "path": "/", "wipeFilesystem": true, "label": "ROOTFS", "mountOptions": [ "defaults", "discard" ] }, { "device": "/dev/vda1", "format": "vfat", "path": "/boot", "label": "BOOT" } ] } } ``` -------------------------------- ### Install libblkid-devel on RPM-based systems Source: https://coreos.github.io/ignition/development Installs the necessary libblkid-devel package on RPM-based Linux distributions like Fedora or CentOS, required for Ignition development. ```Shell sudo dnf install libblkid-devel ``` -------------------------------- ### Create Files and Directories Source: https://coreos.github.io/ignition/configuration-v3_4 Defines files, directories, and symbolic links to be created. Each entry requires a unique `path`. For files, `contents` (with `source` or `inline data`) and `mode` can be specified. For directories, `mode` is used. Symbolic links require a `link` target. ```json { "files": [ { "path": "/etc/hostname", "contents": { "source": "data:text/plain;charset=utf-8,my-hostname", "verification": null }, "mode": 420 }, { "path": "/etc/ssh/sshd_config", "contents": { "source": "data:text/plain;charset=utf-8,PermitRootLogin%20yes%5CnPasswordAuthentication%20no", "verification": null }, "mode": 420 }, { "path": "/opt/my-app", "directory": { "mode": 755 } }, { "path": "/usr/bin/my-link", "link": { "target": "/opt/my-app/bin" } } ] } ``` -------------------------------- ### Create Files and Directories Source: https://coreos.github.io/ignition/configuration-v3_3 Defines files, directories, and symbolic links to be created. Each entry requires a unique `path`. For files, `contents` (with `source` or `inline data`) and `mode` can be specified. For directories, `mode` is used. Symbolic links require a `link` target. ```json { "files": [ { "path": "/etc/hostname", "contents": { "source": "data:text/plain;charset=utf-8,my-hostname", "verification": null }, "mode": 420 }, { "path": "/etc/ssh/sshd_config", "contents": { "source": "data:text/plain;charset=utf-8,PermitRootLogin%20yes%5CnPasswordAuthentication%20no", "verification": null }, "mode": 420 }, { "path": "/opt/my-app", "directory": { "mode": 755 } }, { "path": "/usr/bin/my-link", "link": { "target": "/opt/my-app/bin" } } ] } ``` -------------------------------- ### Initial Release of Ignition Source: https://coreos.github.io/ignition/release-notes The initial release of Ignition introduces core functionalities for system bootstrapping. It supports disk partitioning, formatting, file writing, RAID configuration, and the creation of users and groups. -------------------------------- ### Configure Disk Partitioning Source: https://coreos.github.io/ignition/configuration-v3_2 Specifies the desired state of storage disks, including wiping partition tables and defining partitions with specific sizes, labels, and GUIDs. Supports GPT partition types and GUIDs. ```json { "storage": { "disks": [ { "device": "/dev/vda", "wipeTable": true, "partitions": [ { "label": "BOOT", "number": 1, "sizeMiB": 512, "typeGuid": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" }, { "label": "ROOT", "number": 2, "sizeMiB": 0, "startMiB": 512, "typeGuid": "0FC63DAF-8483-4772-8E79-3D69D8477DE4", "guid": "A1B2C3D4-E5F6-7890-1234-567890ABCDEF", "resize": true } ] } ] } } ``` -------------------------------- ### Modify systemd Service with Drop-in Source: https://coreos.github.io/ignition/examples This example demonstrates how to modify an existing systemd service, 'systemd-journald.service', by adding a drop-in configuration. The drop-in sets the SYSTEMD_LOG_LEVEL environment variable to 'debug'. The configuration is in JSON format for Ignition. ```json { "ignition": { "version": "3.0.0" }, "systemd": { "units": [{ "name": "systemd-journald.service", "dropins": [{ "name": "debug.conf", "contents": "[Service]\nEnvironment=SYSTEMD_LOG_LEVEL=debug" }] }] } } ``` -------------------------------- ### Append File Contents in Ignition Source: https://coreos.github.io/ignition/migrating-configs Demonstrates how to append multiple content sources to a single file in Ignition. The first example shows the older method using 'append: true' for each entry, while the second example illustrates the newer, consolidated approach using an 'append' list. ```json { "ignition": { "version": "2.3.0" }, "storage": { "files": [{ "filesystem": "root", "path": "/example-file", "mode": 420, "append": true, "contents": { "source": "data:,hello" } }, { "filesystem": "root", "path": "/example-file", "mode": 420, "append": true, "contents": { "source": "data:,world" } }] } } ``` ```json { "ignition": { "version": "3.0.0" }, "storage": { "files": [{ "path": "/example-file", "mode": 420, "append": [ { "source": "data:,hello" }, { "source": "data:,world" } ] }] } } ``` -------------------------------- ### Create Files and Directories Source: https://coreos.github.io/ignition/configuration-v3_5 Defines files, directories, and symbolic links to be created. Each entry requires a unique `path`. For files, `contents` (with `source` or `inline data`) and `mode` can be specified. For directories, `mode` is used. Symbolic links require a `link` target. ```json { "files": [ { "path": "/etc/hostname", "contents": { "source": "data:text/plain;charset=utf-8,my-hostname", "verification": null }, "mode": 420 }, { "path": "/etc/ssh/sshd_config", "contents": { "source": "data:text/plain;charset=utf-8,PermitRootLogin%20yes%5CnPasswordAuthentication%20no", "verification": null }, "mode": 420 }, { "path": "/opt/my-app", "directory": { "mode": 755 } }, { "path": "/usr/bin/my-link", "link": { "target": "/opt/my-app/bin" } } ] } ``` -------------------------------- ### Add oem:// Scheme Support Source: https://coreos.github.io/ignition/release-notes Ignition now supports the `oem://` scheme for configuration URLs. This allows referencing configurations stored on OEM-specific partitions or devices. -------------------------------- ### Configure Filesystems Source: https://coreos.github.io/ignition/configuration-v3_3 Sets up filesystems on specified devices. Requires `device` and `format` (e.g., ext4, xfs, btrfs, vfat, swap, none). Optional parameters include mount point (`path`), filesystem label, UUID, format options, and mount options. The `wipeFilesystem` option can be used to clear existing data. ```json { "storage": { "filesystems": [ { "device": "/dev/vda2", "format": "ext4", "path": "/", "wipeFilesystem": true, "label": "rootfs", "options": [ "-E", "lazy_itable_init=0,lazy_journal_init=0" ], "mountOptions": [ "defaults", "discard" ] }, { "device": "/dev/vda1", "format": "vfat", "path": "/boot" } ] } } ``` -------------------------------- ### Configure Filesystems Source: https://coreos.github.io/ignition/configuration-v3_4 Sets up filesystems on specified devices. Requires `device` and `format` (e.g., ext4, xfs, btrfs, vfat, swap, none). Optional parameters include mount point (`path`), filesystem label, UUID, format options, and mount options. The `wipeFilesystem` option can be used to clear existing data. ```json { "storage": { "filesystems": [ { "device": "/dev/vda2", "format": "ext4", "path": "/", "wipeFilesystem": true, "label": "rootfs", "options": [ "-E", "lazy_itable_init=0,lazy_journal_init=0" ], "mountOptions": [ "defaults", "discard" ] }, { "device": "/dev/vda1", "format": "vfat", "path": "/boot" } ] } } ``` -------------------------------- ### Directory Configuration in Ignition Source: https://coreos.github.io/ignition/configuration-v3_1 Specifies how to create and configure directories, including path, overwrite behavior, permissions, and ownership. ```json { "path": "/path/to/directory", "overwrite": true, "mode": 493, // 0755 in decimal "user": { "id": 1000, "name": "user" }, "group": { "id": 1000, "name": "group" } } ``` -------------------------------- ### Configure Filesystems Source: https://coreos.github.io/ignition/configuration-v3_5 Sets up filesystems on specified devices. Requires `device` and `format` (e.g., ext4, xfs, btrfs, vfat, swap, none). Optional parameters include mount point (`path`), filesystem label, UUID, format options, and mount options. The `wipeFilesystem` option can be used to clear existing data. ```json { "storage": { "filesystems": [ { "device": "/dev/vda2", "format": "ext4", "path": "/", "wipeFilesystem": true, "label": "rootfs", "options": [ "-E", "lazy_itable_init=0,lazy_journal_init=0" ], "mountOptions": [ "defaults", "discard" ] }, { "device": "/dev/vda1", "format": "vfat", "path": "/boot" } ] } } ``` -------------------------------- ### Add new `vagrant-virtualbox` oem Source: https://coreos.github.io/ignition/release-notes Introduces a new OEM configuration specifically for Vagrant environments using VirtualBox. This facilitates easier provisioning of systems within Vagrant setups. ```Go // No specific code snippet provided for this change, but it implies a new OEM configuration file or structure. ``` -------------------------------- ### Configure File with Contents and Verification Source: https://coreos.github.io/ignition/configuration-v3_3 Defines a file with specified content, including source URL, compression, HTTP headers, and hash verification. Supports various schemes like http, https, tftp, s3, gs, and data. ```json { "path": "/etc/example.conf", "contents": { "source": "http://example.com/config.yaml", "compression": "gzip", "httpHeaders": [ { "name": "Authorization", "value": "Bearer " } ], "verification": { "hash": "sha512-" } }, "mode": 420, "user": { "id": 1000, "name": "user" }, "group": { "id": 1000, "name": "group" } } ``` -------------------------------- ### Configure Directory with Permissions and Ownership Source: https://coreos.github.io/ignition/configuration-v3_4 Creates a directory with specified permissions and ownership. Supports overwriting existing paths and setting user/group IDs. ```json { "path": "/opt/myapp/data", "overwrite": true, "mode": 493, "user": { "name": "appuser" }, "group": { "name": "appgroup" } } ``` -------------------------------- ### Ignition: Support Unmasking Systemd Units Source: https://coreos.github.io/ignition/release-notes Introduces the ability to unmask systemd units, allowing services that were previously masked to be enabled and started. This provides more control over service states during provisioning. ```Go // Conceptual Go code for unmasking systemd units. // This feature was added in Ignition 2.8.0. // Ignition configuration would include a way to specify the desired state of systemd units. // For unmasking, a 'masked: false' or similar flag would be used. // Example Systemd unit configuration: type SystemdUnit struct { Name string `json:"name"` Enabled *bool `json:"enabled,omitempty"` Masked *bool `json:"masked,omitempty"` // If false, unmask the unit Content string `json:"content,omitempty"` Dropins []SystemdDropin `json:"dropins,omitempty"` } // When Ignition processes a unit with `"masked": false`, // it would execute the equivalent of `systemctl unmask `. ``` -------------------------------- ### Add support for reading user configs from initramfs Source: https://coreos.github.io/ignition/release-notes Enables Ignition to read user-specific configurations directly from the initramfs, allowing for more dynamic and flexible system bootstrapping. ```Go // No specific code snippet provided for this change, but it implies changes to config loading mechanisms. ``` -------------------------------- ### Configure Filesystems Source: https://coreos.github.io/ignition/configuration-v3_2 Sets up filesystems on storage devices, specifying the device, format type (ext4, btrfs, xfs, vfat, swap), mount path, and optional wipe, label, UUID, and mount options. ```json { "storage": { "filesystems": [ { "device": "/dev/vda2", "format": "ext4", "path": "/", "wipeFilesystem": true, "label": "ROOTFS", "mountOptions": [ "defaults", "discard" ] }, { "device": "/dev/vda1", "format": "vfat", "path": "/boot", "label": "BOOT" } ] } } ``` -------------------------------- ### Configure LUKS Device with Custom Clevis Source: https://coreos.github.io/ignition/configuration-v3_4 Configures a LUKS encrypted device with a custom Clevis binding, allowing direct specification of the pin and configuration JSON. This provides flexibility for advanced or non-standard Clevis setups. ```json { "luks": [ { "name": "custom-clevis-volume", "device": "/dev/nvme0n1p3", "clevis": { "custom": { "pin": "tpm2", "config": "{\"pcr": \"0x17\"}", "needsNetwork": false } } } ] } ``` -------------------------------- ### Configure File with Contents and Verification Source: https://coreos.github.io/ignition/configuration-v3_4 Defines a file with specified content, optional overwrite, compression, and verification using a hash. Supports various source URL schemes. ```json { "path": "/etc/example.conf", "contents": { "source": "http://example.com/config.yaml", "verification": { "hash": "sha512-abcdef123456..." } }, "mode": 420, "user": { "id": 1000 }, "group": { "id": 1000 } } ``` -------------------------------- ### Fetch Configs from EC2 Source: https://coreos.github.io/ignition/release-notes This fix ensures that Ignition can properly fetch configuration files from the Amazon EC2 metadata service. This is crucial for systems booting on EC2 instances that rely on Ignition for initial setup. -------------------------------- ### Zap GPT Tables on Partial Validity Source: https://coreos.github.io/ignition/release-notes When GPT (GUID Partition Table) tables are found to be partially valid, Ignition now correctly 'zaps' them. This prevents potential issues with disk partitioning when dealing with corrupted or incomplete GPT data. -------------------------------- ### Use Bash for Build and Test Scripts Source: https://coreos.github.io/ignition/release-notes Ignition's build and test scripts have been migrated from `make` to `bash`. This change may offer more flexibility and portability for the build process.