Butane with merge local does not convert to ignition

I am using core-os on proxmox and I use a butane file that merges other ignition files via http (using source:)

Now I would like to use only local files, so I am replacing source: with local: but I cannot get that to work.

This is the Butane file that I cannot get to work:

variant: fcos
version: 1.5.0
ignition:
  config:
    merge:
    - local: ign/include/ssh.ign
    - local: ign/include/add-compose.ign
    - local: ign/include/music.ign
    - local: ign/include/start-docker.ign
storage:
  files:
  - path: /etc/hostname
    contents:
      inline: examplehost

This is the output:

$ butane yaml/example-local.yaml -d /home/dries/workspaces/proxmox-coreos 
error at $.ignition.config.merge.1, line 8 col 7: duplicate entry defined
error at $.ignition.config.merge.2, line 9 col 7: duplicate entry defined
error at $.ignition.config.merge.3, line 10 col 7: duplicate entry defined
Error translating config: config generated was invalid

When I use source: it just works

variant: fcos
version: 1.5.0
ignition:
  config:
    merge:
    - source: http://www-fc.familie-dokter.lan/ign/include/ssh.ign
    - source: http://www-fc.familie-dokter.lan/ign/include/add-compose.ign
    - source: http://www-fc.familie-dokter.lan/ign/include/music.ign
    - source: http://www-fc.familie-dokter.lan/ign/include/start-docker.ign
storage:
  files:
  - path: /etc/hostname
    contents:
      inline: examplehost

This file converts without a problem to ignition:

$ butane yaml/example.yaml
{"ignition":{"config":{"merge":[{"source":"http://www-fc.familie-dokter.lan/ign/include/ssh.ign"},{"source":"http://www-fc.familie-dokter.lan/ign/include/add-compose.ign"},{"source":"http://www-fc.familie-dokter.lan/ign/include/music.ign"},{"source":"http://www-fc.familie-dokter.lan/ign/include/start-docker.ign"}]},"version":"3.4.0"},"storage":{"files":[{"path":"/etc/hostname","contents":{"compression":"","source":"data:,examplehost"}}]}}

Specification at: Fedora CoreOS v1.6.0 | Butane
From that specification I cannot understand why the behavior is different.

Another thing that bugs me:
When I use merge local: a check is done if the local .ign file exists during ign creation. This check is not performed for merge source:.

It does not make sense to check this at .ign creation. I create the .ign files on my desktop, but use them on my proxmox server (which means when I actually use them, the files are at another location)

The local files are merged when generating the Ignition config from the Butane one so Butane has to check if they exists at the moment that you are generating your Ignition config.

Can you open an issue in the Butane upstream issue tracker with what you’ve written here so that we can investigate? Thanks!

Ah okay, makes sense!

I will, thanks for your reply!

1 Like