coreos / butane

Butane translates human-readable Butane Configs into machine-readable Ignition Configs.
https://coreos.github.io/butane/
Apache License 2.0
255 stars 70 forks source link

Add sugar for `.container` systemd quadlet units #497

Open jbtrystram opened 1 year ago

jbtrystram commented 1 year ago

The following butane config fails to transpile :

variant: fcos
version: 1.5.0
systemd:
  units:
    - name: target
      enabled: true
      contents_local: target.container

when ran :

$ podman run --rm -v ./:/srv:z quay.io/coreos/butane:release --pretty --strict -d /srv /srv/target.bu > transpiled_config.ign
error at $.systemd.units.0.name, line 14 col 13: invalid systemd unit extension
Error translating config: config generated was invalid

https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html

travier commented 1 year ago

Quadlets are "just" files in /etc/containers/systemd/ so there is nothing to add in Ignition. Butane could grow some validation logic but not usre how much that would be useful / comprehensive.

travier commented 1 year ago

Moving back to Butane.

stocky37 commented 11 months ago

For what it's worth, I also ran it into this just now. It still occurs when using target.container as the unit name.

travier commented 11 months ago

For what it's worth, I also ran it into this just now. It still occurs when using target.container as the unit name.

This happens because quadlet are not systemd units, so you can not use this syntax to set them in Butane.

See https://github.com/travier/fedora-coreos-matrix for an example config using quadlets.

stocky37 commented 11 months ago

Yeah, makes sense. Thanks for the example config.