{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "ignition",
    "type": "object",
    "properties": {
        "ignition": {
            "$ref": "#/definitions/ignition"
        },
        "storage": {
            "$ref": "#/definitions/storage"
        },
        "systemd": {
            "$ref": "#/definitions/systemd"
        },
        "networkd": {
            "$ref": "#/definitions/networkd"
        },
        "passwd": {
            "$ref": "#/definitions/passwd"
        }
    },
    "required": [
        "ignition"
    ],
    "definitions": {
        "verification": {
            "type": "object",
            "properties": {
                "hash": {
                    "type": [
                        "string",
                        "null"
                    ]
                }
            }
        },
        "ignition": {
            "type": "object",
            "properties": {
                "version": {
                    "type": "string"
                },
                "config": {
                    "$ref": "#/definitions/ignition/definitions/ignition-config"
                },
                "timeouts": {
                    "$ref": "#/definitions/ignition/definitions/timeouts"
                },
                "security": {
                    "$ref": "#/definitions/ignition/definitions/security"
                }
            },
            "definitions": {
                "ignition-config": {
                    "type": "object",
                    "properties": {
                        "append": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/ignition/definitions/config-reference"
                            }
                        },
                        "replace": {
                            "$ref": "#/definitions/ignition/definitions/config-reference"
                        }
                    }
                },
                "security": {
                    "type": "object",
                    "properties": {
                        "tls": {
                            "type": "object",
                            "properties": {
                                "certificateAuthorities": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/definitions/ignition/definitions/ca-reference"
                                    }
                                }
                            }
                        }
                    }
                },
                "config-reference": {
                    "type": [
                        "object",
                        "null"
                    ],
                    "properties": {
                        "source": {
                            "type": "string"
                        },
                        "verification": {
                            "$ref": "#/definitions/verification"
                        }
                    },
                    "required": [
                        "source"
                    ]
                },
                "ca-reference": {
                    "type": [
                        "object",
                        "null"
                    ],
                    "properties": {
                        "source": {
                            "type": "string"
                        },
                        "verification": {
                            "$ref": "#/definitions/verification"
                        }
                    },
                    "required": [
                        "source"
                    ]
                },
                "timeouts": {
                    "type": "object",
                    "properties": {
                        "httpResponseHeaders": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "httpTotal": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        }
                    }
                }
            }
        },
        "storage": {
            "type": "object",
            "properties": {
                "disks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/storage/definitions/disk"
                    }
                },
                "raid": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/storage/definitions/raid"
                    }
                },
                "filesystems": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/storage/definitions/filesystem"
                    }
                },
                "files": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/storage/definitions/file"
                    }
                },
                "directories": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/storage/definitions/directory"
                    }
                },
                "links": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/storage/definitions/link"
                    }
                }
            },
            "definitions": {
                "disk": {
                    "type": "object",
                    "properties": {
                        "device": {
                            "type": "string"
                        },
                        "wipeTable": {
                            "type": "boolean"
                        },
                        "partitions": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/storage/definitions/partition"
                            }
                        }
                    },
                    "required": [
                        "device"
                    ]
                },
                "raid": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "level": {
                            "type": "string"
                        },
                        "spares": {
                            "type": "integer"
                        },
                        "devices": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "options": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    "required": [
                        "name",
                        "level",
                        "devices"
                    ]
                },
                "filesystem": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "mount": {
                            "$ref": "#/definitions/storage/definitions/mount"
                        },
                        "path": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    }
                },
                "file": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/storage/definitions/node"
                        },
                        {
                            "type": "object",
                            "properties": {
                                "mode": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "contents": {
                                    "$ref": "#/definitions/storage/definitions/file-contents"
                                },
                                "append": {
                                    "type": "boolean"
                                }
                            }
                        }
                    ]
                },
                "directory": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/storage/definitions/node"
                        },
                        {
                            "type": "object",
                            "properties": {
                                "mode": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                }
                            }
                        }
                    ]
                },
                "link": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/storage/definitions/node"
                        },
                        {
                            "type": "object",
                            "properties": {
                                "target": {
                                    "type": "string"
                                },
                                "hard": {
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "target"
                            ]
                        }
                    ]
                },
                "partition": {
                    "type": "object",
                    "properties": {
                        "label": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "number": {
                            "type": "integer"
                        },
                        "size": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "start": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "sizeMiB": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "startMiB": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "typeGuid": {
                            "type": "string"
                        },
                        "guid": {
                            "type": "string"
                        },
                        "wipePartitionEntry": {
                            "type": "boolean"
                        },
                        "shouldExist": {
                            "type": [
                                "boolean",
                                "null"
                            ]
                        }
                    }
                },
                "mount": {
                    "type": [
                        "object",
                        "null"
                    ],
                    "properties": {
                        "device": {
                            "type": "string"
                        },
                        "format": {
                            "type": "string"
                        },
                        "options": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "wipeFilesystem": {
                            "type": "boolean"
                        },
                        "label": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "uuid": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "create": {
                            "type": [
                                "object",
                                "null"
                            ],
                            "properties": {
                                "force": {
                                    "type": "boolean"
                                },
                                "options": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "required": [
                        "device",
                        "format"
                    ]
                },
                "file-contents": {
                    "type": "object",
                    "properties": {
                        "compression": {
                            "type": "string"
                        },
                        "source": {
                            "type": "string"
                        },
                        "verification": {
                            "$ref": "#/definitions/verification"
                        }
                    }
                },
                "node": {
                    "type": "object",
                    "properties": {
                        "filesystem": {
                            "type": "string"
                        },
                        "path": {
                            "type": "string"
                        },
                        "overwrite": {
                            "type": [
                                "boolean",
                                "null"
                            ]
                        },
                        "user": {
                            "type": [
                                "object",
                                "null"
                            ],
                            "properties": {
                                "id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "name": {
                                    "type": "string"
                                }
                            }
                        },
                        "group": {
                            "type": [
                                "object",
                                "null"
                            ],
                            "properties": {
                                "id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "name": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "required": [
                        "filesystem",
                        "path"
                    ]
                }
            }
        },
        "systemd": {
            "type": "object",
            "properties": {
                "units": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/systemd/definitions/unit"
                    }
                }
            },
            "definitions": {
                "unit": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "enable": {
                            "type": "boolean"
                        },
                        "enabled": {
                            "type": [
                                "boolean",
                                "null"
                            ]
                        },
                        "mask": {
                            "type": "boolean"
                        },
                        "contents": {
                            "type": "string"
                        },
                        "dropins": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/systemd/definitions/dropin"
                            }
                        }
                    },
                    "required": [
                        "name"
                    ]
                },
                "dropin": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "contents": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "name"
                    ]
                }
            }
        },
        "networkd": {
            "type": "object",
            "properties": {
                "units": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/networkd/definitions/networkdunit"
                    }
                }
            },
            "definitions": {
                "networkdunit": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "contents": {
                            "type": "string"
                        },
                        "dropins": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/networkd/definitions/dropin"
                            }
                        }
                    },
                    "required": [
                        "name"
                    ]
                },
                "dropin": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "contents": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "name"
                    ]
                }
            }
        },
        "passwd": {
            "type": "object",
            "properties": {
                "users": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/passwd/definitions/user"
                    }
                },
                "groups": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/passwd/definitions/group"
                    }
                }
            },
            "definitions": {
                "user": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "passwordHash": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "sshAuthorizedKeys": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "uid": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "gecos": {
                            "type": "string"
                        },
                        "homeDir": {
                            "type": "string"
                        },
                        "noCreateHome": {
                            "type": "boolean"
                        },
                        "primaryGroup": {
                            "type": "string"
                        },
                        "groups": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "noUserGroup": {
                            "type": "boolean"
                        },
                        "system": {
                            "type": "boolean"
                        },
                        "noLogInit": {
                            "type": "boolean"
                        },
                        "shell": {
                            "type": "string"
                        },
                        "create": {
                            "$ref": "#/definitions/passwd/definitions/usercreate"
                        }
                    },
                    "required": [
                        "name"
                    ]
                },
                "group": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "gid": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "passwordHash": {
                            "type": "string"
                        },
                        "system": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "name"
                    ]
                },
                "usercreate": {
                    "type": [
                        "object",
                        "null"
                    ],
                    "properties": {
                        "uid": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "gecos": {
                            "type": "string"
                        },
                        "homeDir": {
                            "type": "string"
                        },
                        "noCreateHome": {
                            "type": "boolean"
                        },
                        "primaryGroup": {
                            "type": "string"
                        },
                        "groups": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "noUserGroup": {
                            "type": "boolean"
                        },
                        "system": {
                            "type": "boolean"
                        },
                        "noLogInit": {
                            "type": "boolean"
                        },
                        "shell": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    }
}