{"id":13623423,"url":"https://github.com/csanquer/gitlab-setup","last_synced_at":"2026-01-24T16:58:18.816Z","repository":{"id":59974953,"uuid":"71106280","full_name":"csanquer/gitlab-setup","owner":"csanquer","description":"A Packer / Terraform / Ansible configuration to install Gitlab and Gitlab-CI","archived":false,"fork":false,"pushed_at":"2017-12-27T09:30:25.000Z","size":38,"stargazers_count":58,"open_issues_count":0,"forks_count":29,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-08T11:46:05.492Z","etag":null,"topics":["ansible","aws","gitlab","gitlab-ci","immutable-server","infrastructure-as-code","packer","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csanquer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-17T06:21:57.000Z","updated_at":"2024-05-03T12:02:16.000Z","dependencies_parsed_at":"2022-09-25T11:43:21.746Z","dependency_job_id":null,"html_url":"https://github.com/csanquer/gitlab-setup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csanquer%2Fgitlab-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csanquer%2Fgitlab-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csanquer%2Fgitlab-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csanquer%2Fgitlab-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csanquer","download_url":"https://codeload.github.com/csanquer/gitlab-setup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249089070,"owners_count":21210912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","aws","gitlab","gitlab-ci","immutable-server","infrastructure-as-code","packer","terraform"],"created_at":"2024-08-01T21:01:31.653Z","updated_at":"2026-01-24T16:58:18.784Z","avatar_url":"https://github.com/csanquer.png","language":"HCL","funding_links":[],"categories":["HCL"],"sub_categories":[],"readme":"Gitlab HA setup template on AWS\n===============================\n\nThis template is a POC to setup a [Gitlab](https://about.gitlab.com/) system with [High Availability](https://about.gitlab.com/high-availability/)  on [Amazon Web Service Cloud](https://aws.amazon.com/).\n\nThis template is heavily inspired by [Gitlab university : HA on AWS](https://docs.gitlab.com/ce/university/high-availability/aws/).\n\n\nThe project tries to follow Immutable server pattern and Infrastructure-as-Code principles by using :\n* [Packer](https://www.packer.io/) to create [Amazon Virtual Machine Images (AMI)](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html)\n* [Ansible](https://www.ansible.com/) to install and configure packages on these Virtual Machine Images when running Packer\n* [Terraform](https://www.terraform.io/) to create and orchestrate the cloud infrastructure\n* [cloud-init](https://cloudinit.readthedocs.io/en/latest/) and [jinja2-cli](https://github.com/mattrobenolt/jinja2-cli) to finalize setup automatically when launching AWS instances from AMI\n* [Docker](https://www.docker.com/) to run Continuous Integration in containers with [Gitlab-CI](https://about.gitlab.com/gitlab-ci/)\n\n\nRequirements\n------------\n\n* a [AWS account](https://aws.amazon.com/) (**Be careful this template implies creating billable resources on AWS cloud**)\n\n  You will need an [AWS access key](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) and enough admin permissions to create AWS ressources\n* a [AWS Route 53 DNS zone](http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html) already created (the template will add new subdomain DNS A records)\n* a SSH Key pair to connect to Gitlab and AWS instances (see [Github help for examples](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/))\n* [Packer](https://www.packer.io/) \u003e= 0.12\n* [Terraform](https://www.terraform.io/) \u003e= 8.2\n* GNU Make or some Unix equivalent Implementation\n* *(optional)* [Graphiz](http://www.graphviz.org/) to generate Terraform config Graph Images \n  ```sh\n  # on ubuntu/debian\n  sudo apt-get install graphviz\n  ```\n\n\nUsage\n-----\n\n### Download the terraform and packer templates\n\n```sh\ngit clone --recursive https://github.com/csanquer/gitlab-setup.git\n```\n\n### To create the Gitlab infrastructure\n\n1. Copy and edit the configuration files :\n\n  * **terraform** : `terraform/terraform.dist.tfvars` to `terraform/terraform.tfvars`\n  * **packer** : `packer/config.dist.json` to `packer/config.json`\n  \n2. create Amazon Machine Images :\n\n  * Gitlab \n  * Gitlab-CI-multirunner \n\n  ```sh\n  make ami\n  ```\n  \n3. check Terraform plan \n\n  ```sh\n  make plan\n  ```\n\n3. if terraform plan is correct, create AWS resources by applying the terraform plan\n\n  ```sh\n  make apply\n  ```\n\n  * you can check again the terraform exported variables output\n    ```sh\n    make output\n    ```\n  * you can also get Graphviz graphs of all terraform config\n    ```sh\n    # in PNG image format\n    make graphs\n    # or in SVG\n    make graphs format=svg\n    ```\n\nAfter creation, wait for a few minutes the autoscaled gitlab instances finish self initialization.\n\nif variables are set in `terraform/terraform.tvars` like :\n```hcl\naws_dns_zone = \"my-aws.net\"\ngitlab_dns_subdomain = \"gitlab\"\n```\n\nThe Gitlab server should be available to http://gitlab.my-aws.net/ \n\n### To destroy the Gitlab infrastructure \n\n```sh\nmake destroy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsanquer%2Fgitlab-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsanquer%2Fgitlab-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsanquer%2Fgitlab-setup/lists"}