diff --git a/docs/examples.md b/docs/examples.md index 50a7a122..7b563ab9 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -374,6 +374,48 @@ systemd: WantedBy=multi-user.target ``` +### Creating derived configs + +A common scenario will be to have a "base" Ignition config, and +you want to create machine-specific versions that e.g. contain +static IP addressing, a static `/etc/hostname`, etc. + +Another common scenario is to have a pool of some bare metal machines +with one set of disk configuration, and another set that differs. + +In the following, the `base.ign` is an Ignition config file you +have locally, generated via whatever mechanism you prefer (could also be butane, or not). +These examples just change the value of `/etc/hostname`, but everything +above (storage configuration etc.) can be added too. + + +```yaml +variant: fcos +version: 1.1.0 +ignition: + config: + merge: + - local: base.ign +files: + - path: /etc/hostname + contents: + inline: foo.example.com +``` + + +```yaml +variant: fcos +version: 1.1.0 +ignition: + config: + merge: + - local: base.ign +files: + - path: /etc/hostname + contents: + inline: bar.example.com +``` + [spec]: specs.md [dropins]: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Description [fcos-auth-docs]: https://docs.fedoraproject.org/en-US/fedora-coreos/authentication