…and if someone needs a working example for Butane (.yaml) and Ignition (.ign) configs:
butane_example.yaml file:
(Don’t forget to change the username, SSH keys, hostname, disk IDs, network interface name, network IPs and so on)
variant: fcos
version: 1.4.0
passwd:
groups:
- name: yourusername
gid: 1000
users:
- name: root
ssh_authorized_keys:
- "ssh-ed25519 AAAAyourPublicKeyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX yourname@example.com"
# test1234
password_hash: $6$sxfGOnw5tPck1LoS$N.YsNpCFM1MnbmAUGqmmZt/wy.42ugI7K1ZcGBfp4XdufTXxst1.I0u297hCWf.CKWxNwQ9joSgdh7KU96VKH1
- name: yourusername
uid: 1000
primary_group: yourusername
ssh_authorized_keys:
- "ssh-ed25519 AAAAyourPublicKeyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX yourname@example.com"
# test1234
password_hash: $6$sxfGOnw5tPck1LoS$N.YsNpCFM1MnbmAUGqmmZt/wy.42ugI7K1ZcGBfp4XdufTXxst1.I0u297hCWf.CKWxNwQ9joSgdh7KU96VKH1
home_dir: /home/yourusername
shell: /bin/bash
storage:
disks:
- device: "/dev/disk/by-id/wwn-0x50014ee21264eceb"
wipe_table: true
partitions:
- number: 1
size_mib: 0
label: opt
filesystems:
- path: /home
device: "/dev/disk/by-id/wwn-0x5002538d40db1ab0-part3"
format: btrfs
wipe_filesystem: false
with_mount_unit: true
mount_options:
- "subvol=/@/home"
- path: /opt
device: "/dev/disk/by-partlabel/opt"
format: btrfs
wipe_filesystem: true
with_mount_unit: true
files:
- path: /etc/hostname
mode: 0644
overwrite: true
contents:
inline: yourhostname
- path: /etc/NetworkManager/system-connections/enp1s0.nmconnection
mode: 0600
contents:
inline: |
[connection]
id=enp1s0
uuid=b5344841-0f14-4406-b699-c9d70cc198f9
type=ethernet
autoconnect-priority=-100
autoconnect-retries=1
interface-name=enp1s0
multi-connect=1
[ethernet]
[ipv4]
address1=192.168.0.5/23
dns=192.168.0.1;
gateway=192.168.0.1
may-fail=false
method=manual
[ipv6]
method=disabled
[proxy]
systemd:
units:
- name: sshd.service
enabled: true
- name: cockpit.socket
enabled: true
That Butane config file can now be converted into Ignition using Podman (…or Docker…):
podman run --interactive --rm quay.io/coreos/butane:release --pretty --strict < butane_example.yaml > ignition_example.ign
That ignition_example.ign file can now be used for installing a new server.