Giter VIP home page Giter VIP logo

ansible-role-gogs's Introduction

Ansible Role: Gogs

DEPRECATED: This project is no longer actively maintained. I recommend using an alternative like Gitea.

CI

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:
    - geerlingguy.gogs

Inside vars/main.yml:

gogs_http_port: "8080"

License

MIT / BSD

Author Information

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

ansible-role-gogs's People

Contributors

geerlingguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-gogs's Issues

i386 libpam problem on an Ubuntu 14.04 LTS amd64 setup

It seems that, for the aforementioned distribution/version/architecture combination Gogs would always fail to start due to the lack of a 64-bit libpam.so.0 package.

A simple solution is to switch to an i386 gogs package, and setting the default in such a way will probably be better in Ubuntu's case (although no idea about 16.04 LTS at the moment).

Unsynced startup script settings

Currently, the startup script seems to be merely unpacked from the Gogs distribution and symlinked to init.d. This makes the various role customization vars (most notably the user setting) worse then useless, since the service will be inconsistently configured and unable to start.

To reproduce, simply alter gogs_user or gogs_user_home in the role configuration and run the role on a fresh setup.

Make Gogs work out of the box on RHEL/CentOS 7

The init script included with Gogs seems to not want to work with RHEL/CentOS 7. See: https://travis-ci.org/geerlingguy/ansible-role-gogs/jobs/109519333#L858

TASK: [role_under_test | Ensure Gogs is running.] ***************************** 
failed: [localhost] => {"failed": true}
msg: Failed to start gogs.service: Unit gogs.service failed to load: No such file or directory.

I even tried explicitly restarting the systemctl daemon but that didn't seem to help (I had the following code inside init-setup.yml):

# SEE: https://github.com/ansible/ansible-modules-core/issues/191
- name: Restart systemctl daemon on systemd systems.
  shell: systemctl daemon-reload
  when: gogs_file_symlinks.changed and (ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 7)

Failed to run tests on MacOS 10.11

MacOS 10.11
docker-machine version 0.12.2, build 9371605 (via brew)
docker version 17.07.0-ce, build 8784753 (via brew)

When I run the tests, I get this error when it tries to enable and run the service.

TASK [role_under_test : Ensure Gogs is running.] *******************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/bin/systemctl", "failed": true, "msg": "Failed to get D-Bus connection: Unknown error -1", "rc": 1, "stderr": "Failed to get D-Bus connection: Unknown error -1\n", "stderr_lines": ["Failed to get D-Bus connection: Unknown error -1"], "stdout": "", "stdout_lines": []}

I haven't been able to find anything online regarding this, but it seems to be an issue with docker on MacOS, as the tests with Travis are obviously passing.

@geerlingguy or anyone else, any idea how to fix this?

Does gogs_http_port work?

I set it to a different port but it still attempts to run on 3000. I searched the repo for gogs_http_port for how it is used and only two instances show up: in the README and the default setting. Is this setting used at all?

Gogs starting before mysql

Hi, first thanks for the great work!

I'm creating this "issue" because I saw you have this

templates/gogs.unit.j2:#After=mysqld.service

but it doesn't uncomment when gogs_use_mysql: true...

How can I do that? This is making gogs not come back when the box is rebooted.

Thanks,
Felipe

Fix build failures on systemd systems in Ansible 2.2+

See related: ansible/ansible-modules-core#915

Build failure: https://travis-ci.org/geerlingguy/ansible-role-gogs/jobs/178326322

TASK [role_under_test : Ensure Gogs is running.] *******************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Could not find the requested service \"'gogs'\": "}

We're currently relying on the init scripts here: https://github.com/gogits/gogs/tree/master/scripts/init

But for systemd systems, we should use the unit file (like https://github.com/gogits/gogs/blob/master/scripts/systemd/gogs.service). To make it work on all systems correctly, we'll have to template our own copy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.