{
  "$schema": "http://json-schema.org/draft-07/schema",
  "title": "distro-signatures",
  "description": "The different distributions supported by Cobbler. This schema is valid for Cobbler with major version 3, whose bundled autoinstall templates are registered with a 'built-in-' name prefix, reflected in default_autoinstall values here.",
  "type": "object",
  "properties": {
    "breeds": {
      "description": "The set of supported operating system breeds (e.g. redhat, debian, suse), each mapping to its supported versions.",
      "type": "object",
      "patternProperties": {
        "redhat|debian|ubuntu|suse|vmware|freebsd|xen|unix|windows|powerkvm|generic": {
          "anyOf": [
            {
              "type": "object",
              "patternProperties": {
                "^[a-zA-Z0-9]*$": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "signatures": {
                          "description": "One or more paths, relative to the root of the ISO, whose existence identifies this OS version.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "version_file": {
                          "description": "The regular expression which points to the file with the os-version info.",
                          "type": ["string", "null"]
                        },
                        "version_file_regex": {
                          "description": "The regular expression matched against the contents of the file located via version_file to confirm this version.",
                          "type": ["string", "null"]
                        },
                        "kernel_arch": {
                          "description": "The regular expression which tells Cobbler where to look for the architecture of the operating system. In some cases this may also be a path to the file where Cobbler should look for the architecture.",
                          "type": "string"
                        },
                        "kernel_arch_regex": {
                          "description": "The regex applied within the file located via kernel_arch when it doesn't point to the architecture directly.",
                          "type": ["string", "null"]
                        },
                        "supported_arches": {
                          "type": "array",
                          "description": "The architectures Cobbler considers valid when detecting the architecture of an imported distro.",
                          "items": {
                            "type": "string",
                            "enum": [
                              "arm",
                              "ARM64",
                              "armhfp",
                              "armhf",
                              "aarch64",
                              "i386",
                              "i586",
                              "ia64",
                              "ppc",
                              "ppc64",
                              "ppc64le",
                              "ppc64el",
                              "s390",
                              "s390x",
                              "x86_64",
                              "amd64",
                              "AMD64",
                              "x86",
                              "riscv64"
                            ]
                          }
                        },
                        "supported_repo_breeds": {
                          "description": "The repository breeds Cobbler may auto-create when it finds a matching repo in the install tree.",
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "rsync",
                              "rhn",
                              "yum",
                              "apt"
                            ]
                          }
                        },
                        "kernel_file": {
                          "description": "The regular expression to match to find the kernel.",
                          "type": "string"
                        },
                        "initrd_file": {
                          "description": "The regular expression to match to find the initrd.",
                          "type": "string"
                        },
                        "isolinux_ok": {
                          "description": "Whether directories named isolinux should still be scanned for a kernel/initrd pair instead of being skipped.",
                          "type": "boolean"
                        },
                        "default_autoinstall": {
                          "description": "The filename for the default autoinstall template in Cobbler.",
                          "type": "string"
                        },
                        "kernel_options": {
                          "description": "Default kernel options to apply to the imported ISO.",
                          "type": "string"
                        },
                        "kernel_options_post": {
                          "description": "Default kernel post options to apply to the imported ISO.",
                          "type": "string"
                        },
                        "template_files": {
                          "description": "Extra files merged into the imported distro's template_files, used to render templated boot files (e.g. ESXi's boot.cfg).",
                          "type": "string"
                        },
                        "boot_files": {
                          "description": "Extra files, beyond the kernel and initrd, that must be copied out of the source tree and templated for the distro.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "boot_loaders": {
                          "description": "The boot loaders Cobbler considers valid for this OS version, keyed by architecture.",
                          "type": "object",
                          "properties": {
                            "arm": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "armhfp": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "aarch64": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "i386": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "ia64": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "ppc": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "ppc64": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "ppc64le": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "s390": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "s390x": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            },
                            "x86_64": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pxe",
                                  "ipxe",
                                  "grub"
                                ]
                              }
                            }
                          }
                        }
                      },
                      "required": [
                        "signatures",
                        "version_file",
                        "kernel_arch",
                        "supported_arches",
                        "supported_repo_breeds",
                        "kernel_file",
                        "initrd_file",
                        "default_autoinstall",
                        "kernel_options",
                        "kernel_options_post"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "required": [
    "breeds"
  ]
}
