This project we installed GitLab server using Terraform , on a CentOS 7 only for testing purpose.
In order to Terraform deploy resources , you need to deside :
- what cloud provider are you going to use.
- Set credentials with proper permissions.
When you start builing infrastracture using Terraform, you begin writing configuration files create all your resources. We create a VPC and all other components that you can use is following:
-
3 private, 3 public subnets
-
Public subnets attached to IGW.
-
Private subnets attached to NG.
-
Configure Route tables
-
Create Public and private keys
-
Add Security groups and open nessasarly ports
-
Create Variables and tags
-
Create instance
-
Creating S3 bucket
-
SSH to instance Install GitLab server using "remote-exec" defined in null.resource file.
We choose AWS for provider and it's in the provider.tf file. Terraform needs to initialize with provider AWS.
provider.tf
Run:
terraform init
Once Terraform initialized with cloud provider, same time it will download plugin for you. it's time to run terraform plan command and see what resources will be created.
Run:
terraform plan -var-file devtf.vars
This is expected Infrastructure Architecture .
If you are happy with plan, It's time to deploy your resources with terraform apply command.
Run:
terraform apply -var-file dev.tfvars
Once installation is succesfully completed you will see the GitLab Logo on your terminal.
The last step is Configure GitLab through the Web Interface. Now that you have configured the GitLab URL you can start with the initial configuration through the GitLab web interface.
The first time you access the web interface you’ll be prompted to set the password for the administrative account.
Enter a secure password and click on the Change your password button when you are finished.
You will be redirected to the login page:
The default administrative account username is root. Later in this tutorial, we will show you how to change the username.
Username: root Password: [the password you have set] Enter the login credentials, click the Sign in button and you will be redirected to the GitLab Welcome page.
Welcome to GitLab!