Skip to content

Ansible role for setting up a dockerized gitea server

License

Notifications You must be signed in to change notification settings

salessandri/ansible-gitea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitea

This role sets up a Gitea server using its docker image.

This only takes care of setting up the service, its configuration is done through the web interface the first time the service runs.

Requirements

This role relies on docker being available on the host and the docker_container ansible module in ansible.

To cover the first one, the geerlingguy.docker role can be used.

To cover the dependencies for the docker_container module the geerlingguy.pip role can be used to install Python's docker package.

As with any git server, using SSH is recommended for accessing the repos thus a port will need to be forwarded to the SSH port of the container. This doesn't have to be the standard SSH port.

Also, gitea provides a web interface so access to it should be provided. It is recommended that a reverse proxy such as nginx is used for that purpose.

Role Variables

  • gitea__version (optional, default: 1.22.2): Image version tag to use.
  • gitea__container_name (optional, default: gitea-server): Name to use for the container created by the role.
  • gitea__data_dir (optional, default /var/gitea/): Folder to use for storing the persistent files.
  • gitea__ssh_port (optional, default: 2222): Port where the container will publish the gitea's SSH port.
  • gitea__web_host (optional, default: 127.0.0.1): Address where the container will publish gitea's web socket.
  • gitea__web_port (optional, default: 3000): Port where the container will publish the gitea's web port.
  • gitea__hostname (optional, default: localhost): Domain name to use for the displayed http clone URL in the UI.
  • gitea__root_url (optional, default: http://localhost:3000/): Base URL to use for all internal links. Use the actual URL that will be used to access the service. E.g. https://git.example.com/
  • gitea__enable_lfs (optional, default: no): Enabled git-lfs support.
  • gitea__app_name (optional): Application name, used in the page title.

Example Playbook

The following would be a fairly common role usage example:

- host: git.my-domain.com
  roles:
    - role: salessandri.gitea
    - vars:
        gitea__hostname: git.my-domain.com
        gitea__root_url: https://git.my-domain.com/

License

MIT

Author Information

This role was created in 2020 by Santiago Alessandri.

About

Ansible role for setting up a dockerized gitea server

Resources

License

Stars

Watchers

Forks

Packages

No packages published