A Terraform Module to Provision Gitlab Resources on Gitlab Instance
Add Users Details
variable "gitlab_token" {
type = "string"
}
variable "base_url" {
type = "string"
}
variable "users" {
default = {}
}
module "add_users" {
source = "../../"
gitlab_token = var.gitlab_token
base_url = var.base_url
users = var.users
}
{
"users": {
"aditya.singh@northwind.in": {
"username": "aditya.singh",
"email": "aditya.singh@northwind.in",
"password": "password@123",
"groups_access": {},
"projects_access": {}
},
"raj.singh@northwind.in": {
"username": "raj.singh",
"email": "raj.singh@northwind.in",
"password": "password@123",
"groups_access": {},
"projects_access": {}
}
}
}
Add Groups
variable "gitlab_token" {
type = "string"
}
variable "base_url" {
type = "string"
}
variable groups {
default = {}
}
module "add_groups" {
source = "../../"
gitlab_token = var.gitlab_token
base_url = var.base_url
groups = var.groups
}
{
"groups": {
"northwind-wave-2": {
"group_name": "northwind-wave-2",
"group_description": "A Group for entire northwind Wave 1"
},
"northwind-mentors-1": {
"group_name": "northwind-mentors-1",
"group_description": "Group Created for northwind mentors"
},
"northwind-auditors-1": {
"group_name": "northwind-auditors-1",
"group_description": "Group Created for auditors"
}
}
}
Add Users to Groups
variable "gitlab_token" {
type = "string"
}
variable "base_url" {
type = "string"
}
variable "users" {
default = {}
}
variable "groups" {
default = {}
}
variable "user_namespaces" {
default = {}
}
variable "group_namespaces" {
default = {}
}
module "add_groups_users" {
source = "../../"
gitlab_token = var.gitlab_token
base_url = var.base_url
groups = var.groups
users = var.users
user_namespaces = var.user_namespaces
group_namespaces = var.group_namespaces
}
{
"groups": {
"northwind-wave-2": {
"group_name": "northwind-wave-2",
"group_description": "A Group for entire northwind Wave 1"
},
"northwind-mentors-1": {
"group_name": "northwind-mentors-1",
"group_description": "Group Created for northwind mentors"
},
"northwind-auditors-1": {
"group_name": "northwind-auditors-1",
"group_description": "Group Created for auditors"
}
}
}
{
"users": {
"aditya.singh@northwind.in": {
"username": "aditya.singh",
"email": "aditya.singh@northwind.in",
"password": "password@123",
"groups_access": {},
"projects_access": {}
},
"raj.singh@northwind.in": {
"username": "raj.singh",
"email": "raj.singh@northwind.in",
"password": "password@123",
"groups_access": {},
"projects_access": {}
}
}
}
{
"group_namespaces": {
"northwind-wave-2": {
"group_name": "northwind-wave-2"
},
"northwind-mentors-1": {
"group_name": "northwind-mentors-1"
},
"northwind-auditors-1": {
"group_name": "northwind-auditors-1"
}
},
"user_namespaces": {
"aditya.singh": {
"email": "aditya.singh@northwind.in"
},
"raj.singh": {
"email": "raj.singh@northwind.in"
},
"harry.potter": {
"email": "harry.potter@northwind.in"
},
"alice.wonderland": {
"email": "alice.wonderland@northwind.in"
}
}
}
Add Projects to Groups
variable "gitlab_token" {
type = "string"
}
variable "base_url" {
type = "string"
}
variable "users" {
default = {}
}
variable "projects" {
default = {}
}
variable "groups" {
default = {}
}
variable "user_namespaces" {
default = {}
}
variable "group_namespaces" {
default = {}
}
module "add_users_projects" {
source = "../../"
gitlab_token = var.gitlab_token
base_url = var.base_url
projects = var.projects
groups = var.groups
user_namespaces = var.user_namespaces
group_namespaces = var.group_namespaces
}
{
"groups": {
"northwind-wave-2": {
"group_name": "northwind-wave-2",
"group_description": "A Group for entire northwind Wave 1"
},
"northwind-mentors-1": {
"group_name": "northwind-mentors-1",
"group_description": "Group Created for northwind mentors"
},
"northwind-auditors-1": {
"group_name": "northwind-auditors-1",
"group_description": "Group Created for auditors"
}
}
}
{
"group_namespaces": {
"northwind-wave-2": {
"group_name":"northwind-wave-2"
},
"northwind-mentors-1": {
"group_name": "northwind-mentors-1"
},
"northwind-auditors-1": {
"group_name": "northwind-auditors-1"
}
},
"user_namespaces": {}
}
{
"projects": {
"mentors-project-1": {
"name": "mentors-project-1",
"description": "This is only the Test Project",
"visibility_level": "private",
"namespace_id": "northwind-mentors-1",
"only_allow_merge_if_pipeline_succeeds": false,
"shared_with_groups": {}
},
"users-project-1": {
"name": "users-project-1",
"description": "This is only the Test Project",
"visibility_level": "private",
"namespace_id": "northwind-auditors-1",
"only_allow_merge_if_pipeline_succeeds": true,
"shared_with_groups": {
"northwind-wave-2": "guest"
}
}
}
}
Contributions to this Module are very much welcome. Checkout the Contribution Guidelines for instructions.
Changelog to this terraform module are logged here on Changelog.
Incase of Issues or Feature requests log it here in the issues section.
This code is release under MIT License. Please see LICENSE for more details.