Go to file
Denis Knauf c0d4049302 listen [::]:443 added 2022-03-16 20:29:36 +01:00
defaults init 2020-09-15 16:43:53 +02:00
files init 2020-09-15 16:43:53 +02:00
handlers init 2020-09-15 16:43:53 +02:00
meta meta 2020-09-16 14:27:54 +02:00
tasks asciidoctor installation and showtitle 2021-05-20 13:36:05 +02:00
templates listen [::]:443 added 2022-03-16 20:29:36 +01:00
tests init 2020-09-15 16:43:53 +02:00
vars init 2020-09-15 16:43:53 +02:00
.gitignore Initial commit 2020-09-15 16:45:37 +02:00
LICENSE Initial commit 2020-09-15 16:45:37 +02:00
README.adoc asciidoctor installation and showtitle 2021-05-20 13:36:05 +02:00

README.adoc

gitea - Git with a cup of tea
=============================

____
A painless self-hosted Git service.
Gitea is a community managed lightweight code hosting solution written in Go. It is published under the MIT license.
____

It installs nginx, postgresql and gitea for you git-service.

Requirements
------------

You need to have debian (or compatible, like ubuntu) or alpine already installed.

* sshd

It will install all dependencies on host-machine:

* Postgresql
* nginx
* gitea - itself

It expects for TLS a PKI in `/etc/nginx/tls/`,
where you have to place `**hostname**.key`, `**hostname**.crt`.

Role Variables
--------------

gitea_version::
You need to define it, it cannot determine newest version, yet.

gitea_download_uri::
The URI to the binary.
You need to define it, it cannot determine newest version, yet.

gitea_fqdn::
Full qualified domain name for the webserver.

gitea_root_uri::
The Link to your gitea service.  Default `https://{{gitea_fqdn}}/`.

Example Playbook
----------------

This determines the newest version of gitea automatically.
So it defines `gitea_version` and `gitea_download_uri` for you.

It uses a host `local`, which you have to define in your inventory.
Set `ansible_host=localhost` for this host.
It uses this host for fetching needed informations once.

----
---
# vim: set expandtab tabstop=2 shiftwidth=2:

- hosts: gitea
  remote_user: root
  become: false

  tasks:
  - delegate_to: local
    run_once: true
    remote_user: root
    become: false
    apt:
      name:
      - ruby-dev
      - make
      - gcc
  - delegate_to: local
    run_once: true
    remote_user: root
    become: false
    gem:
      user_install: false
      name: '{{item}}'
    with_items:
    - oga
    - httpclient
  - name: determine newest provided version
    delegate_to: local
    become: false
    run_once: true
    shell: |
      ruby -roga -rhttpclient <<EOF
      puts Oga.parse_html( HTTPClient.get_content( "https://dl.gitea.io/gitea/")).
        css( "tr.file a[href] .name").
        map {|a| a.text.chomp.split ?. }.
        select {|v| v.grep( /\D/).empty? }.
        map {|v| v.map &:to_i }.
        max.
        join( ?.)
      EOF
    register: det_gitea_ver
  - set_fact:
      gitea_version: '{{gitea.version | default(det_gitea_ver.stdout)}}'
  - set_fact:
      gitea_download_uri: '{{gitea.uri | default("https://dl.gitea.io/gitea/"+gitea_version+"/gitea-"+gitea_version+"-linux-"+gitea_architectures_map[ansible_architecture])}}'                
  - import_role:
      name: gitea
----

License
-------

AGPLv3

Author Information
------------------

Denis Knauf - https://git.denkn.at/deac/ansible-role-gitea