README.md 2.0 KB

Ansible Role: Gogs

Build Status

Installs Gogs, a Go-based front-end to Git, on RedHat or Debian-based linux systems.

After the playbook is finished, visit the gogs server (on port 3000 by default), and you will be redirected to the /install page, where you can configure an administrator account and other default options.

Requirements

Requires git (via geerlingguy.git), and at least the Gogs HTTP port (3000 by default) open on your system's firewall. Install MySQL (e.g. via geerlingguy.mysql) prior to installing Gogs if you would like to use MySQL instead of built-in SQLite support.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

gogs_user: git
gogs_user_home: /home/git

The user and home under which Gogs will run and be installed.

gogs_binary_url: https://github.com/gogits/gogs/releases/download/v0.3.1/linux_amd64.zip

Download URL for the Gogs binary.

gogs_http_port: "3000"

HTTP port over which Gogs will be accessed.

gogs_use_mysql: false
gogs_db_name: gogs
gogs_db_username: gogs
gogs_db_password: root

MySQL database support. Set gogs_use_mysql to true to configure MySQL for gogs, using the database name, username, and password defined by the respective variables.

Dependencies

  • geerlingguy.git

Example Playbook

- hosts: servers
  vars_files:
    - vars/main.yml
  roles:
    - { role: geerlingguy.gogs }

Inside vars/main.yml:

gogs_http_port: "8080"

TODO

  • Preconfigure gogs so installation is simpler/more robust.
  • Make Gogs version more easily configurable.
  • (Maybe) add option to build Gogs from source (instead of binary installation).

License

MIT / BSD

Author Information

This role was created in 2014 by Jeff Geerling, author of Ansible for DevOps.