Skip to content

Create / Import


This section contains documentation for repository tasks.

Create Repository

Ansible Tag Action Check Mode Supported Required
Variables
Description
gitea - - - Ensures that Gitea related tasks run. Mandatory for Gitea
Create Organisation
Repository
Yes git_gitea_create_repo_org Creates a git repository
Migrate Repository Yes git_gitea_repo_migrate Imports a git repository. This will occur if variable git_repo_clone_addr is set, failing to set this variable and no repository will be migrated.
No Tags - - - If no tags are specified, then no task will run.

Create task enables the creation of a git repository. This includes importing a repository. The Tasks are smart enough to determine between a user and an organization repository.

Variables

Variables for each task are a mapping of the required keys that form the body of the API request. The mappings for each task are as defined in the table above.

Create Organisation Repository

To obtain the keys and values for mapping git_gitea_create_repo_org, navigate to your local gitea's swagger docs for endpoint POST /repos/{owner}/{repo}.

In addition, the following table lists variables, that if you set will be over-ridden. To set the value of the variable, set the value of the source variable.

Name Source
Variable
default_branch git_repo_default_branch
description git_repo_description
name git_repo_name
private git_repo_private

Create User Repository

Not yet supported.

Migrate repository

To obtain the keys and values for mapping git_gitea_repo_migrate, navigate to your local gitea's swagger docs for endpoint POST /repos/migrate.

In addition, the following table lists variables, that if you set will be over-ridden. To set the value of the variable, set the value of the source variable.

Name Source
Variable
clone_addr git_repo_clone_addr
description git_repo_description
mirror_interval git_gitea_config.mirror_interval
private git_repo_private
repo_name git_repo_name
repo_owner git_repo_owner

Workflow

The create task follows the following workflow.

flowchart LR


    START(create)

        START --> FETCH_USER


    subgraph Repository

    FETCH_USER[Fetch Authenticated User]

        FETCH_USER --> USER_MATCH


        USER_MATCH{user=-repo_name-}

            USER_MATCH -->| yes | REPO_TYPE_USER

            USER_MATCH -->| no | REPO_TYPE_ORG


        REPO_TYPE_USER[repo_type = user]

            REPO_TYPE_USER --> REPO


        REPO_TYPE_ORG[repo_type = oganisation]

            REPO_TYPE_ORG --> REPO



    REPO[Fetch Repositories]

        REPO --> REPO_EXISTS


        REPO_EXISTS{exists}

            REPO_EXISTS -->| yes | FETCH_REPO

            REPO_EXISTS -->| no | CREATE_REPO


        FETCH_REPO[Fetch Repository]

            FETCH_REPO --> CREATE_REPO_AGGREGATE_CONFIG


    CREATE_REPO[Create Repo]

        CREATE_REPO --> CREATE_REPO_AGGREGATE_CONFIG

    CREATE_REPO_AGGREGATE_CONFIG[Build Config from returned data]


    end

    CREATE_REPO_AGGREGATE_CONFIG --> FINISH

    FINISH[Finished]

About:

This page forms part of our Project Centurion Role Git.

Page Metadata
Version: ToDo: place files short git commit here
Date Created: 2025-12-26
Date Edited: 2026-01-06

Contribution:

Would You like to contribute to our Centurion Role Git project? You can assist in the following ways:

 

ToDo: Add the page list of contributors