When comparing GitLab vs Ansible, the Slant community recommends Ansible for most people. In the question“What are the best DevOps tools?” Ansible is ranked 1st while GitLab is ranked 4th. The most important reason people chose Ansible is:
Ansible does not use agents. Instead, all master-agent communications are handled via SSH commands or through the Paramiko module which provides a Python interface to SSH.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro At feature parity with GitHub
Gitlab is very close to Github in use and feel, written in Ruby on Rails, open source and hosted on Github as well as on GitLab.com
Pro Regular updates
GitLab is being constantly worked on and has a new release every month on the 22nd. Updating is also very easy through a single apt-get command.
Pro Has wikis and pages
Wiki and pages support out of the box.
Pro Supports pull requests
Has pull request (AKA, merge request) support.
Pro Easy to install with the packages
With the packages available here, GitLab can be installed in two minutes.
Pro Support for protected branches
A protected master branch means that no code can be merged to master without passing a code review by an authorised developer. With GitLab this comes out of the box.
Pro Good web UI
GitLab's UI is clean and intuitive. Each view is designed to not fill the screen with useless information.
It displays the activity in a feed-type way in the most prominent part of the view. On top of that, there's a toolbar with buttons which can filter this feed by pushes, merge events or comments.
On the left, there's a menu that displays all the links that take you to the different views. For example, a file directory which displays all the files in that repo, a commit view which displays all the commits in cronological order, a network and a graph view that display important information graphically etc...
All these details make GitLab's UI extremely intuitive and easy to use, no view is overflown with information and every view displays only the most useful and crucial information needed at that time.
Pro Issue tracking support
Has issue tracking out of the box. Creating tickets, commenting on issues, closing issues etc... It's all there out of the box.
Pro Integrates fully with LDAP
The Lightweight Directory Access Protocol is an application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network.
GitLab EE adds additional functionality over CE such as support for multiple LDAP servers and group sync.
Pro Comes with integrated CI/CD solution
GitLab CI makes it easy to set up CI and deployment for projects in GitLab. It supports parallel testing, multiple platforms, Docker containers and streaming build logs.
Pro Permissions and roles are supported
It has private/public repositories, roles for users (master, developer, reporter, guest). All of these can be set from the user interface. Same permissions set for the UI work for the SSH as well.
Pro Supports Approvers/Reviewers of Pull/Merge requests
Since 7.12 you can define a minimum number of approvers for merge requests.
Pro "Snippets" support
Snippets are similar to (well-known) GitHub "gists". They are a way to share code or have conversations about anything without needing a full git repo. The implementation here reminds more of a sort of pastebin.
Pro Scalable
A single instance can handle up to 40,000 users (requires a server with 64 core CPU and 64 GB of RAM) and it can run on multiple application servers to grow beyond that.
Pro Integrates with other systems by webhooks
Integrates out of the box with services like Bugzilla, Pushbullet, Microsoft Team Notification and many more - one can also add own webhooks to integrate with own services.
Pro Manages large files and binaries with integrated Git Annex
Git Annex enables Git to manage large files (esp binaries) without checking them into Git.
Pro Can provide a Docker registry
The default docker.io registry is the docker hub but you can also login to other docker registries. And GitLab provides one for all Repos that make use of this feature.
Pro Most GitLab EE features become part of GitLab CE after time
EE is the commercial Enterprise Edition, CE is the free and OpenScource Community Edition. Features such as Cycle Analytics were first a part of the EE and are now also available in CE.
Pro Integration with third party applications
GitLab integrates with multiple third-party services to allow external issue trackers and external authentication.
GitLab can integrate with many third-party apps to allow external issue tracking and authentication. It can also be integrated with several services, such as:
- Slack
- Campfire
- Flowdock
- Hipchat
- Gemnasium
- Pivotal Tracker
Pro Very feature rich RESTful-API
GitLab exposes a REST API that allows automation possible, like PR bots.
Pro Allows Timetracking with Cycle-Analytics
Very useful project management feature that allows you to know how long it takes to go from the idea to production.
Pro Agentless
Ansible does not use agents. Instead, all master-agent communications are handled via SSH commands or through the Paramiko module which provides a Python interface to SSH.
Pro Gentle learning curve
Ansible is agentless, making it quick and painless to setup. Ansible has clear and detailed documentation and provides plenty of built-in modules. Its DSL is obtained using YAML and a familiar template system.
Pro Simple tasks can be run from the command line
Some simple tasks such as triggering updates or reboots, or even checking if the service is running can be done without configuration files. These commands can be run from the command line instead.
Pro Support for major cloud providers
Ansible supports managing major cloud devices (AWS, RackSpace, Digital Ocean, OpenStack) through a collection of modules which are available.
Pro Extensible in any language / runtime
Although you may need to preinstall favorite programming environment, Ansible modules are accessed via shell calls and therefore any executable on the remote system built for use with Ansible may be used as an Ansible module.
Pro Web UI
Ansible has a Web UI in the form of AnsibleWorks AWX which unfortunately does not tie directly into the CLI. So configuration elements present in the CLI can not appear in the UI unless a sync pass is run. Although the Web UI is helpful and functional, it's still not as complete feature-wise as the CLI.
Pro Easy to customize
Ansible is very easy to customize. It doesn't force you to use a language with which you are unfamiliar. Instead, all commands are packaged into YAML modules which are called playbooks. So as long as you use a programming language that can output JSON, you are able to customize it.
Pro Rich diff
Modules that support rich diffs can expose nearly every detail of what will change. However not all core modules support diffs, so there may still be some opaque chances made.
Pro Creating reusable components is simple
Making roles modular and reusable is a fast process with Ansible.
Cons
Con Not lightweight
GitLab is demanding, Gitea is a much more lightweight solution which uses less CPU and memory.
Con The upgrade process fails more often than not
Even for minor versions such as 9.2.0 to 9.3.0. Sometimes the upgrade failure is silent and only seen when logging in first time after update and an http 502 error is given.
Con Not all features are free
GitLab's Service Desk features and some more are only available in GitLab EE.
Con Kind of slow
Con LDAP lacking
importing groups from ldap is only available in EE (Entreprise Edition) not in CE(Community Edition)
Con Requires at least 1GB of RAM
The default installation is meant for already many users and recommends 2GB of RAM. 1GB is possible but results in some HTTP 500 errors. On a Raspberry Pi 2 it runs fine most of the time, though it eats 75% of the RAM.
Another option is to reduce unicorn['worker_processes']
in gitlab.rb.
Con Bad code review possibilities
No precommit reviews.
Con Security risks
Con Slow
Compared to other tools, Ansible requires more time to complete the same actions.
Con Somewhat weak documentation
Ansible is still relatively new, as far as server automation tools go. This is the reason that many users have found it's documentation lacking in some parts. Although this is mitigated by the fact that it's very easy to learn to use.
Con Too easy to move the port in the crappy scripts you've been using for years
If you have an extensive codebase of scripts, your users might find it too easy to just port in the same unsupportable crappy scripts they've been using for years.
Con Doesn't have its own inventory system
Ansible really depends on you to provide it a list of nodes to run on and doesn't actively maintain a central inventory
Con No Python API available, despite the fact that Ansible is written in Python
Despite being written and taking good advantage of the python environment, Ansible offers no python api for programming, and does not make it possible to follow best practices for writing custom Ansible modules.