An Ansible Role to install and configure gitea.
Gitea.io is a git server, written in golang. As a Developer, having such a tool ready is quite mandatory.
This Role install and configures Gitea.io.
- Download the binary
- Create needed directory structure
- Configure the systemd service
- Configure gitea
- Updating does not work automatically
Used Modules:
- Ansible Package Module
- Ansible Service Module
- Ansible Systemd Module
- Ansible User Module
- Ansible Group Module
- Ansible Template Module
- Ansible ini_file Module
- Ansible File Module
- Ansible Firewalld Module
- Ansible get_url Module
- Ansible package_facts Module
Install from Ansible Galaxy
ansible-galaxy install while_true_do.srv_gitea
Install from Github
git clone https://github.com/while-true-do/ansible-role-srv_gitea.git while_true_do.srv_gitea
Dependencies:
You need to have git installed on the destination system and you can use while_true_do.app_git or the role will take care of a basic git installation.
ansible-galaxy install -r requirements.yml
---
# defaults file for while_true_do.srv_gitea
## Package Management
wtd_srv_gitea_package_mode: "binary"
# Only needed for wtd_srv_gitea_package_mode = "binary"
wtd_srv_gitea_package_version: "1.9.2"
wtd_srv_gitea_package_url: "https://dl.gitea.io/gitea/{{ wtd_srv_gitea_package_version }}/gitea-{{ wtd_srv_gitea_package_version }}-linux-amd64"
# State can be present|absent
wtd_srv_gitea_package_state: "present"
## Configuration Management
wtd_srv_gitea_conf_user:
name: "gitea"
group: "gitea"
home: "/home/gitea"
wtd_srv_gitea_conf_port: "3000"
wtd_srv_gitea_conf_var: "/var/lib/gitea"
wtd_srv_gitea_conf_etc: "/etc/gitea"
# Gitea has tons of options. You can get an overview here:
# https://docs.gitea.io/en-us/config-cheat-sheet/
# https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample
wtd_srv_gitea_conf:
- option: "APP_NAME"
value: "Gitea - Git with a cup of tea"
section: null
- option: RUN_MODE
value: "prod"
section: null
- option: "RUN_USER"
value: "{{ wtd_srv_gitea_conf_user.name }}"
section: null
- option: "AUTHOR"
value: "Gitea - Git with a cup of tea"
section: "ui.meta"
- option: "HTTP_PORT"
value: "{{ wtd_srv_gitea_conf_port }}"
section: "server"
- option: "HTTP_ADDR"
value: "0.0.0.0"
section: "server"
- option: "DOMAIN"
value: "localhost"
section: "server"
- option: "ROOT"
value: "{{ wtd_srv_gitea_conf_user.home }}/gitea-repositories"
section: "repository"
## Service Management
wtd_srv_gitea_service: "gitea"
# State can be started|stopped
wtd_srv_gitea_service_state: "started"
wtd_srv_gitea_service_enabled: true
## Firewalld Management
wtd_srv_gitea_fw_mgmt: true
wtd_srv_gitea_fw_port: "{{ wtd_srv_gitea_conf_port }}/tcp"
# State can be enabled|disabled
wtd_srv_gitea_fw_state: "enabled"
# Zone can be according to defined zones on your machine.
wtd_srv_gitea_fw_zone: "public"
Running Ansible Roles can be done in a playbook.
---
- hosts: all
roles:
- role: while_true_do.srv_gitea
Install another version and change the port.
- hosts: all
roles:
- role: while_true_do.srv_gitea
wtd_srv_gitea_conf_port: "8080"
wtd_srv_gitea_package_version: "1.X.Y"
- RedHat Testing is currently not possible in public, due to limitations in subscriptions.
- Some services and features cannot be tested properly, due to limitations in docker.
Most of the "generic" tests are located in the Test Library.
Ansible specific testing is done with Molecule.
Infrastructure testing is done with testinfra.
Automated testing is done with Travis CI.
Thank you so much for considering to contribute. We are very happy, when somebody is joining the hard work. Please fell free to open Bugs, Feature Requests or Pull Requests after reading the Contribution Guideline.
See who has contributed already in the kudos.txt.
This work is licensed under a BSD-3-Clause License.
- Site https://while-true-do.io
- Twitter https://twitter.com/wtd_news
- Code https://github.com/while-true-do
- Mail hello@while-true-do.io
- IRC freenode, #while-true-do
- Telegram https://t.me/while_true_do