Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add a "Creating derived configs" section #265

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,29 @@ systemd:
WantedBy=multi-user.target
```

## Creating derived configs

A common scenario will be to have a "base" Ignition config, and then you want to create machine-specific versions that e.g. contain static IP addressing or a static `/etc/hostname`, etc.

Another common scenario is to have a pool of bare metal machines where some have e.g. SATA disks, other newer machines have NVMe drives, etc.

In the following, the `base.ign` is an Ignition config file you have locally. It could be 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.

<!-- butane-config -->
```yaml
variant: fcos
version: 1.1.0
ignition:
config:
merge:
- local: base.ign
storage:
files:
- path: /etc/hostname
contents:
inline: foo.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
2 changes: 1 addition & 1 deletion test
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mkdir tmpdocs
trap 'rm -r tmpdocs' EXIT
# Create files-dir contents expected by configs
mkdir -p tmpdocs/files-dir/tree
touch tmpdocs/files-dir/{config.ign,ca.pem,file,file-epilogue,local-file3}
touch tmpdocs/files-dir/{base.ign,config.ign,ca.pem,file,file-epilogue,local-file3}

for doc in docs/*md
do
Expand Down