{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/ansible-execution-environment/latest.json",
  "title": "Ansible Execution Environment Schema v1/v3",
  "description": "See <https://docs.ansible.com/projects/builder/en/latest/definition/> for V3 or <https://legacy-controller-docs.ansible.com/automation-controller/> for older V1 format.\n",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/execution-environment.json",
    "sourceSha256": "5378d175a82da16685626a85b98f5f74dc7c04ba0095e9fa0e2e692bd1fa3fa3",
    "fileMatch": [
      "**/execution-environment.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "$defs": {
    "TYPE_DictOrStringOrListOfStrings": {
      "anyOf": [
        {
          "type": "object"
        },
        {
          "type": "string"
        },
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      ]
    },
    "TYPE_StringOrListOfStrings": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      ]
    },
    "v1": {
      "type": "object",
      "properties": {
        "additional_build_steps": {
          "properties": {
            "append": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            },
            "prepend": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            }
          },
          "title": "Commands to append or prepend to container build process.",
          "type": "object"
        },
        "ansible_config": {
          "examples": [
            "ansible.cfg"
          ],
          "title": "Ansible configuration file",
          "type": "string"
        },
        "build_arg_defaults": {
          "type": "object",
          "properties": {
            "EE_BASE_IMAGE": {
              "type": "string"
            }
          },
          "additionalProperties": true
        },
        "dependencies": {
          "description": "Allows adding system, python or galaxy dependencies.",
          "properties": {
            "galaxy": {
              "examples": [
                "requirements.yml"
              ],
              "markdownDescription": "Example `requirements.yml`",
              "title": "Optional galaxy file",
              "type": "string"
            },
            "python": {
              "examples": [
                "requirements.txt"
              ],
              "markdownDescription": "Example `requirements.txt`",
              "title": "Optional python package dependencies",
              "type": "string"
            },
            "system": {
              "examples": [
                "bindep.txt"
              ],
              "markdownDescription": "Example `bindep.txt`",
              "title": "Optional system dependencies using bindep format",
              "type": "string"
            }
          },
          "title": "Dependencies",
          "type": "object"
        },
        "version": {
          "enum": [
            1
          ],
          "title": "Version",
          "type": "integer"
        }
      },
      "required": [
        "version",
        "dependencies"
      ],
      "title": "Ansible Execution Environment Schema v1",
      "additionalProperties": false
    },
    "v3": {
      "type": "object",
      "properties": {
        "additional_build_files": {
          "description": "Describes files to add to the build context",
          "items": {
            "type": "object",
            "properties": {
              "dest": {
                "description": "Relative subdirectory under build context to place file",
                "type": "string"
              },
              "src": {
                "description": "File to add to build context",
                "type": "string"
              }
            },
            "required": [
              "src",
              "dest"
            ],
            "additionalProperties": false
          },
          "type": "array"
        },
        "additional_build_steps": {
          "properties": {
            "append_base": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            },
            "append_builder": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            },
            "append_final": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            },
            "append_galaxy": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            },
            "prepend_base": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            },
            "prepend_builder": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            },
            "prepend_final": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            },
            "prepend_galaxy": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "RUN cat /etc/os-release"
              ]
            }
          },
          "title": "Commands to append or prepend to container build process.",
          "type": "object"
        },
        "build_arg_defaults": {
          "type": "object",
          "properties": {
            "ANSIBLE_GALAXY_CLI_COLLECTION_OPTS": {
              "type": "string"
            },
            "ANSIBLE_GALAXY_CLI_ROLE_OPTS": {
              "type": "string"
            },
            "PKGMGR_PRESERVE_CACHE": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "dependencies": {
          "description": "Allows adding system, python or galaxy dependencies.",
          "properties": {
            "ansible_core": {
              "type": "object",
              "description": "Ansible package installation",
              "oneOf": [
                {
                  "required": [
                    "package_pip"
                  ]
                }
              ],
              "properties": {
                "package_pip": {
                  "description": "Ansible package to install via pip",
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "ansible_runner": {
              "type": "object",
              "description": "Ansible Runner package installation",
              "oneOf": [
                {
                  "required": [
                    "package_pip"
                  ]
                }
              ],
              "properties": {
                "package_pip": {
                  "description": "Ansible Runner package to install via pip",
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "galaxy": {
              "$ref": "#/$defs/TYPE_DictOrStringOrListOfStrings",
              "examples": [
                "requirements.yml"
              ],
              "markdownDescription": "Example `requirements.yml`",
              "title": "Optional galaxy file"
            },
            "python": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "requirements.txt"
              ],
              "markdownDescription": "Example `requirements.txt`",
              "title": "Optional python package dependencies"
            },
            "python_interpreter": {
              "type": "object",
              "description": "Python package name and path",
              "properties": {
                "package_system": {
                  "description": "The python package to install via system package manager",
                  "type": "string"
                },
                "python_path": {
                  "description": "Path to the python interpreter",
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "system": {
              "$ref": "#/$defs/TYPE_StringOrListOfStrings",
              "examples": [
                "bindep.txt"
              ],
              "markdownDescription": "Example `bindep.txt`",
              "title": "Optional system dependencies using bindep format"
            }
          },
          "title": "Dependencies",
          "type": "object"
        },
        "images": {
          "type": "object",
          "properties": {
            "base_image": {
              "name": {
                "examples": [
                  "registry.redhat.io/ansible-automation-platform-21/ee-minimal-rhel8:latest"
                ],
                "type": "string"
              },
              "type": "object"
            }
          },
          "additionalProperties": false
        },
        "options": {
          "type": "object",
          "description": "Options that effect runtime behavior",
          "properties": {
            "container_init": {
              "type": "object",
              "description": "Customize container startup behavior",
              "properties": {
                "cmd": {
                  "description": "literal value for CMD Containerfile directive",
                  "type": "string"
                },
                "entrypoint": {
                  "description": "literal value for ENTRYPOINT Containerfile directive",
                  "type": "string"
                },
                "package_pip": {
                  "description": "package to install via pip for entrypoint support",
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "package_manager_path": {
              "description": "Path to the system package manager to use",
              "type": "string"
            },
            "relax_passwd_permissions": {
              "description": "allows GID0 write access to /etc/passwd; currently necessary for many uses",
              "type": "boolean"
            },
            "skip_ansible_check": {
              "description": "Disables the check for Ansible/Runner in final image",
              "type": "boolean"
            },
            "skip_pip_install": {
              "description": "Disables the installation of pip in the base image",
              "type": "boolean"
            },
            "user": {
              "description": "Sets the username or UID",
              "type": "string"
            },
            "workdir": {
              "description": "Default working directory, also often the homedir for ephemeral UIDs",
              "type": [
                "string",
                "null"
              ]
            },
            "tags": {
              "description": "A list of names to assign to the resulting image if build process completes successfully",
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        },
        "version": {
          "enum": [
            3
          ],
          "title": "Version",
          "type": "integer"
        }
      },
      "required": [
        "version",
        "dependencies"
      ],
      "title": "Ansible Execution Environment Schema v3",
      "additionalProperties": false
    }
  },
  "oneOf": [
    {
      "$ref": "#/$defs/v3"
    },
    {
      "$ref": "#/$defs/v1"
    }
  ],
  "documentation_url": "https://docs.ansible.com/projects/builder/en/latest/definition/",
  "examples": [
    "execution-environment.yml"
  ]
}
