Git Product home page Git Product logo

gitlab-role's Introduction

Gitlab Role

An Ansible role to automate the installation and configuration of Gitlab on CentOS6/7.

Requirements

None

Variables

gitlab_version: 10.3.2

gitlab_gpg_key: https://packages.gitlab.com/gpg.key
gitlab_repo_url: 'https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/config_file.repo?os={{ ansible_distribution }}&dist={{ ansible_distribution_major_version }}'
gitlab_api_root: api/v4

Gitlab API and Access Tokens

Open Issue: Ability to manage Personal Access Tokens through the API

The only way to generate Personal Access Tokens is through the web UI. As such, there is no way to automate the private token necessary to use the API to create projects and configure user ssh keys.

Ok, thanks to a comment from Elvis Stansvik gitlab-rails runner can be used to generate a private token that can be used to automate calls to the Gitlab API. The role will revoke this private token at the end of the role play.

Note that his token is set to revoke after a day, should the playbook fail before this task is ran.

Of course, relying on gitlab-rails runner is SLOW....

Example Playbooks

- hosts: all
  roles:
    - { role: gitlab-role }

Testing

The Vagrantfile can be used to provision a default CentOS7 install using the ansible role

vagrant up

The Gitlab install is accessible at http://127.0.0.1:8000

Alternatively, you can use vagrant to provision the VM and ansible to provision the role

vagrant up --no-provision
ansible-playbook --inventory inventory \
                 --user vagrant \
                 --private-key /home/${USER}/.vagrant.d/insecure_private_key \
                 playbook.yml

You will have to create an inventory file and configure Virtualbox Networking for a local ansible-playbook to access and provision the guest VM...

License

The MIT License (MIT)

Copyright (c) 2018 Brydon Cheyney

gitlab-role's People

Contributors

brydoncheyney avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

matthiasdeblock

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.