Deploy Gitea, your light weight git server on Debian System with ansible playbook
- Copy sample invetory file
inventory.ini.j2
toinventory.ini
withcp inventory.ini.j2 inventory.ini
cp example.inventory.ini inventory.ini
- Change
ansible_host
value with host IP - Add ssh username to
ansible_user
Copy sample variable file located in vars directory
vars.yml.j2
to vars.yml
with cp vars.yml.j2 vars.yml
Install ansible with the following
sudo apt install python3 python3-pip -y`
python3 -m pip install ansible
Run the playbook with
ansible-playbook main.yml
Append -K
if ansible users needs sudo password to elevate sudo privileges
After succesful Deployment visit IP:3000
and fill out the details
We are using SQLite for Database. If you are planning on running gitea with multiple teams and members it is recomended to use MySql.
- Database Type: SQLite3
- Path: Use an absolute path,
/var/lib/gitea/data/gitea.db
- Application General Settings:
- Site Title: Enter your organization name.
- Repository Root Path: Leave the default
var/lib/gitea/data/gitea-repositories
. - Git LFS Root Path: Leave the default
/var/lib/gitea/data/lfs
. - Run As Username:
git
- SSH Server Domain: Enter your domain or server IP address.
- SSH Port:
22
, change it if SSH is listening on other Port - Gitea HTTP Listen Port:
3000
- Gitea Base URL: Use http and your domain or server IP address e.g.
http://127.0.0.1
- Log Path: Leave the default
/var/lib/gitea/log
Expand Optional settings and add details for admin account.
To complete the installation click on install and it'll redirect to the login page.
/etc/gitea
is temporary set with write rights for user git
.
After installation is done, it is recommended to set rights to read-only using:
ansible-playbook post_install.yml
Append -K
if ansible users needs sudo password to elevate sudo privileges
- Start gitea Service
sudo systemctl start gitea
- Stop gitea service
sudo systemctl stop gitea