Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nishant-jain-94/terraform-gitlab-organization
A Terraform Module to Provision Gitlab Resources on Gitlab Instance
https://github.com/nishant-jain-94/terraform-gitlab-organization
gitlab terraform terraform-gitlab terraform-module
Last synced: 5 days ago
JSON representation
A Terraform Module to Provision Gitlab Resources on Gitlab Instance
- Host: GitHub
- URL: https://github.com/nishant-jain-94/terraform-gitlab-organization
- Owner: nishant-jain-94
- License: mit
- Created: 2019-11-11T10:01:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-09T12:28:04.000Z (almost 5 years ago)
- Last Synced: 2024-10-11T07:41:35.706Z (27 days ago)
- Topics: gitlab, terraform, terraform-gitlab, terraform-module
- Language: Go
- Homepage:
- Size: 63.5 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# terraform-gitlab-organization ![](https://github.com/nishant-jain-94/terraform-gitlab-organization/workflows/terraform_testing/badge.svg)
A Terraform Module to Provision Gitlab Resources on Gitlab Instance
## :rocket: Features
- [Add Users](#add-users)
- [Add Groups](#add-groups)
- [Add Users to Groups](#add-users-to-groups)
- [Add Projects to Groups](#add-projects-to-groups)## :information_desk_person: Usage
### Add Users
Add Users Details
#### main.tf
```terraform
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.auto.tfvars.json
```json
{
"users": {
"[email protected]": {
"username": "aditya.singh",
"email": "[email protected]",
"password": "password@123",
"groups_access": {},
"projects_access": {}
},
"[email protected]": {
"username": "raj.singh",
"email": "[email protected]",
"password": "password@123",
"groups_access": {},
"projects_access": {}
}
}
}
```### Add Groups
Add Groups
#### main.tf
```terraform
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.auto.tfvars.json
```json
{
"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
Add Users to Groups
#### main.tf
```terraform
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.auto.tfvars.json
```json
{
"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.auto.tfvars.json
```json
{
"users": {
"[email protected]": {
"username": "aditya.singh",
"email": "[email protected]",
"password": "password@123",
"groups_access": {},
"projects_access": {}
},
"[email protected]": {
"username": "raj.singh",
"email": "[email protected]",
"password": "password@123",
"groups_access": {},
"projects_access": {}
}
}
}
```#### namespaces.auto.tfvars.json
```json
{
"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": "[email protected]"
},
"raj.singh": {
"email": "[email protected]"
},
"harry.potter": {
"email": "[email protected]"
},
"alice.wonderland": {
"email": "[email protected]"
}
}
}
```### Add Projects to Groups
Add Projects to Groups
#### main.tf
```terraform
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.auto.tfvars.json
```json
{
"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"
}
}
}
```#### namespaces.auto.tfvars.json
```json
{
"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.auto.tfvars.json
```json
{
"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"
}
}
}
}
```## :pencil: Contribution Guidelines
Contributions to this Module are very much welcome. Checkout the [Contribution Guidelines](./CONTRIBUTING.md) for instructions.
## :bookmark: Changelog
Changelog to this terraform module are logged here on [Changelog](./CHANGELOG.md).
## :bug: Issues
Incase of Issues or Feature requests log it here in the [issues](https://github.com/nishant-jain-94/terraform-gitlab-organization/issues) section.
## :page_facing_up: License
This code is release under MIT License. Please see [LICENSE](./LICENSE) for more details.