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

Finalize configuration format #104

Open
cilki opened this issue Feb 19, 2023 · 2 comments
Open

Finalize configuration format #104

cilki opened this issue Feb 19, 2023 · 2 comments
Assignees

Comments

@cilki
Copy link
Member

cilki commented Feb 19, 2023

The main bottleneck here is finishing the config format which is a critical component that everything else depends. It's user-facing, so it should be both intuitive and stable.

Some required features:

  • Support multiboot images
  • Flexible enough to conveniently support any kind of operating system
  • Support custom provisioners for certain operating systems (MirrorlistProvisioner for certain Linux distributions, for example)
  • JSON, YAML, and maybe even TOML
  • Documentation can be generated from Rust structs

This format is what I was working towards previously, but I think there's still room for improvement:

{
  "name": "ArchLinux",
  "arch": "x86_64",
  "templates": [
    {
      "base": "ArchLinux",
      "iso_checksum": "sha1:3700a16d4fcabbd29e9a7fbc97da732c4577dc2a",
      "iso_url": "https://mirrors.edge.kernel.org/archlinux/iso/latest/archlinux-2022.05.01-x86_64.iso",
      "mirrorlist": [
        "https://mirrors.edge.kernel.org/archlinux/$repo/os/$arch"
      ],
      "root_password": "root",
      "storage_size": "4Gb",
      "provisioners": [
        {
          "type": "ansible",
          "playbook": "ansible.yml"
        }
      ]
    }
  ]
}

Since the above isn't fully implemented yet, there's still time to pivot onto a slightly better path if there is one.

@cilki cilki added the help wanted Extra attention is needed label Feb 19, 2023
@cilki cilki self-assigned this Feb 19, 2023
@cilki
Copy link
Member Author

cilki commented Feb 19, 2023

TOML might actually be a reasonable format. Something like this is pretty easy to read:

name = "ArchLinux"
arch = "x86_64"
size = "128 Gb"

[[template]]
base = "ArchLinux"

[[template.source.iso]]
checksum = "sha1:3700a16d4fcabbd29e9a7fbc97da732c4577dc2a"
url = "https://mirrors.edge.kernel.org/archlinux/iso/latest/archlinux-2022.05.01-x86_64.iso"

[[template.provisioners.ansible]]
playbook = "ansible.yml"

[[template.provisioners.ansible]]
playbook = "ansible2.yml"

[template.provisioners.root_password]
plaintext = "root"

[template.provisioners.mirrorlist]
mirrors = [ "https://mirrors.edge.kernel.org/archlinux/$repo/os/$arch" ]

@cilki cilki removed the help wanted Extra attention is needed label Nov 20, 2023
@cilki
Copy link
Member Author

cilki commented Nov 20, 2023

There's also RON:

(
  name: "Arch Linux example",
  description: "Example of how to build a simple Arch Linux image",
  arch: "x86_64",
  size: "16 Gb",
  source: Iso (
    checksum: "sha1:3700a16d4fcabbd29e9a7fbc97da732c4577dc2a",
    url: "https://mirrors.edge.kernel.org/archlinux/iso/latest/archlinux-2022.05.01-x86_64.iso",
  ),
  mold: ArchLinux (
    hostname: "ExampleArch",
    mirrorlist: [
      "https://mirrors.edge.kernel.org/archlinux/$repo/os/$arch"
    ],
    root_password: "root",
    packages: [
      "alacritty",
      "git",
      "neovim",
    ]
  ),
  fabricators: [
    Ansible (
      playbook: "ansible.yml"
    )
  ]
)

Although it would be easy to support multiple config formats technically, it's probably a good idea to choose one preferred format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant