Skip to content

Commit 775dac6

Browse files
committed
refs sparkfabrik-innovation-team/board#3833: Update changelog, README, and configuration files for version 1.0.0 release, including new variables and breaking changes
1 parent 6ba72ea commit 775dac6

File tree

5 files changed

+55
-45
lines changed

5 files changed

+55
-45
lines changed

CHANGELOG.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,39 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1010

1111
## [1.0.0] - 2025-10-02
1212

13-
[Compare with previous version](https://github.com/sparkfabrik/terraform-gitlab-kubernetes-gitlab-agent/compare/1.0.0...0.13.0)
13+
[Compare with previous version](https://github.com/sparkfabrik/terraform-gitlab-kubernetes-gitlab-agent/compare/0.13.0...1.0.0)
1414

1515
### Added
1616

17-
- New variable `operate_at_root_group_level` to simplify configuration and replace the combination of `gitlab_agent_grant_access_to_entire_root_namespace` and `gitlab_agent_create_variables_in_root_namespace`
18-
- New variable `groups_enabled` to specify groups where the GitLab Agent should be enabled (when not operating at root group level)
19-
- New variable `projects_enabled` to specify projects where the GitLab Agent should be enabled (when not operating at root group level)
20-
- Auto-detection of parent group when `operate_at_root_group_level = false` and no groups/projects are specified
21-
- Support for creating CI/CD variables in multiple groups and projects simultaneously
22-
- Dynamic generation of agent configuration file based on enabled groups/projects using `yamlencode()`
23-
- New outputs: `gitlab_enabled_groups`, `gitlab_enabled_projects`, `gitlab_parent_group_auto_detected`, `operate_at_root_group_level`
17+
- New variable `operate_at_root_group_level` to simplify configuration and replace the combination of `gitlab_agent_grant_access_to_entire_root_namespace` and `gitlab_agent_create_variables_in_root_namespace`.
18+
- New variable `groups_enabled` to specify groups where the GitLab Agent should be enabled (when not operating at root group level).
19+
- New variable `projects_enabled` to specify projects where the GitLab Agent should be enabled (when not operating at root group level).
20+
- Auto-detection of parent group when `operate_at_root_group_level = false` and no groups/projects are specified.
21+
- Support for creating CI/CD variables in multiple groups and projects simultaneously.
22+
- Dynamic generation of agent configuration file based on enabled groups/projects using `yamlencode()`.
23+
- New outputs: `gitlab_enabled_groups`, `gitlab_enabled_projects`, `gitlab_parent_group_auto_detected`.
2424

2525
### Changed
2626

27-
- Agent configuration file is now dynamically generated based on `operate_at_root_group_level` and enabled groups/projects
28-
- CI/CD variables can now be created in multiple targets (root group, specific groups, or specific projects) depending on configuration
29-
- Output `gitlab_root_namespace_id` now returns `null` when not operating at root group level
30-
- User access (`user_access`) is now controlled directly by `operate_at_root_group_level` and only granted when operating at root group level
27+
- Agent configuration file is now dynamically generated based on `operate_at_root_group_level` and enabled groups/projects.
28+
- CI/CD variables can now be created in multiple targets (root group, specific groups, or specific projects) depending on configuration.
29+
- Output `gitlab_root_namespace_id` now returns `null` when not operating at root group level.
3130

3231
### Removed
3332

34-
- **BREAKING CHANGE**: Variable `gitlab_agent_grant_user_access_to_root_namespace` - functionality is now controlled by `operate_at_root_group_level`
35-
- **BREAKING CHANGE**: Variable `gitlab_agent_grant_access_to_entire_root_namespace` - replaced by `operate_at_root_group_level`
36-
- **BREAKING CHANGE**: Variable `gitlab_agent_create_variables_in_root_namespace` - behavior is now determined by `operate_at_root_group_level`
37-
- Backward compatibility logic for deprecated variables
33+
- **BREAKING CHANGE**: variable `gitlab_agent_grant_access_to_entire_root_namespace` - replaced by `operate_at_root_group_level`.
34+
- **BREAKING CHANGE**: variable `gitlab_agent_create_variables_in_root_namespace` - behavior is now determined by `operate_at_root_group_level`.
35+
- Backward compatibility logic for deprecated variables.
3836

3937
### Migration Guide
4038

4139
If you were using the removed variables, migrate as follows:
4240

43-
- `gitlab_agent_grant_user_access_to_root_namespace = true` `operate_at_root_group_level = true`
44-
- `gitlab_agent_grant_access_to_entire_root_namespace = true` + `gitlab_agent_create_variables_in_root_namespace = true``operate_at_root_group_level = true`
45-
- `gitlab_agent_grant_access_to_entire_root_namespace = false` `operate_at_root_group_level = false` + configure `groups_enabled` and/or `projects_enabled`
41+
- `gitlab_agent_grant_user_access_to_root_namespace = true` -> `operate_at_root_group_level = true` + `gitlab_agent_grant_user_access_to_root_namespace = true`
42+
- `gitlab_agent_grant_access_to_entire_root_namespace = true` + `gitlab_agent_create_variables_in_root_namespace = true``operate_at_root_group_level = true` + `gitlab_agent_grant_user_access_to_root_namespace = true`
43+
- `gitlab_agent_grant_access_to_entire_root_namespace = false` -> `operate_at_root_group_level = false` + configure `groups_enabled` and/or `projects_enabled`
4644

47-
**Note**: User access is now only available when `operate_at_root_group_level = true`. If you need user access to specific groups/projects, this is not currently supported.
45+
**Note**: user access is now only available when `operate_at_root_group_level = true`. If you need user access to specific groups/projects, this is not currently supported by Gitlab.
4846

4947
## [0.12.0] - 2025-05-19
5048

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ It uses the Gitlab provider to register the agent on the Gitlab server. The gene
66

77
The module supports multiple configuration modes:
88

9-
- **Root Group Level** (default): The agent has access to the entire root namespace and CI/CD variables are created in the root group
10-
- **Auto-detect Parent**: When not operating at root level and no specific groups/projects are provided, the module automatically detects the parent group of the agent project
11-
- **Specific Groups/Projects**: Enable the agent only for specific groups or projects, with variables created in those locations
9+
- **Root Group Level** (default): The agent has access to the entire root namespace and CI/CD variables are created in the root group.
10+
- **Auto-detect Parent**: when not operating at root level and no specific groups/projects are provided, the module automatically detects the parent group of the agent project.
11+
- **Specific Groups/Projects**: enable the agent only for specific groups or projects, with variables created in those locations.
1212

1313
**ATTENTION**: you have to manually create the project that will host the Gitlab Agent configuration in Gitlab before running this module.
1414

files/config.yaml.tftpl

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
1+
%{~ if operate_at_root_group_level ~}
12
ci_access:
23
groups:
34
- id: ${root_namespace}
45

5-
%{~ if operate_at_root_group_level }
66
user_access:
77
access_as:
88
agent: {}
99
groups:
1010
- id: ${root_namespace}
11+
%{~ else ~}
12+
%{~ if length(groups_to_enable) > 0 || length(projects_to_enable) > 0 ~}
13+
ci_access:
14+
%{~ if length(groups_to_enable) > 0 ~}
15+
groups:
16+
%{~ for group in groups_to_enable ~}
17+
- id: ${group}
18+
%{~ endfor ~}
19+
%{~ endif ~}
20+
%{~ if length(projects_to_enable) > 0 ~}
21+
projects:
22+
%{~ for project in projects_to_enable ~}
23+
- id: ${project}
24+
%{~ endfor ~}
25+
%{~ endif ~}
26+
%{~ endif ~}
1127
%{~ endif ~}
1228

13-
%{~ if trimspace(gitlab_agent_append_to_config_file) != "" }
29+
%{~ if trimspace(gitlab_agent_append_to_config_file) != "" ~}
1430
${gitlab_agent_append_to_config_file}
1531
%{~ endif ~}

main.tf

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,14 @@ locals {
3737
)
3838

3939
# Gitlab Agent configuration file
40-
final_configuration_file_content = var.gitlab_agent_custom_config_file_content != "" ? var.gitlab_agent_custom_config_file_content : (
41-
var.operate_at_root_group_level ? templatefile("${path.module}/files/config.yaml.tftpl", {
42-
root_namespace = data.gitlab_group.root_namespace.path,
43-
gitlab_agent_append_to_config_file = var.gitlab_agent_append_to_config_file,
44-
operate_at_root_group_level = var.operate_at_root_group_level
45-
}) : (
46-
length(local.groups_to_enable) > 0 || length(local.projects_to_enable) > 0 ? yamlencode({
47-
ci_access = merge(
48-
length(local.groups_to_enable) > 0 ? {
49-
groups = [for g in local.groups_to_enable : { id = g }]
50-
} : {},
51-
length(local.projects_to_enable) > 0 ? {
52-
projects = [for p in local.projects_to_enable : { id = p }]
53-
} : {}
54-
)
55-
}) : ""
56-
)
57-
)
40+
final_configuration_file_content = var.gitlab_agent_custom_config_file_content != "" ? var.gitlab_agent_custom_config_file_content : templatefile("${path.module}/files/config.yaml.tftpl", {
41+
operate_at_root_group_level = var.operate_at_root_group_level
42+
root_namespace = data.gitlab_group.root_namespace.path
43+
groups_to_enable = local.groups_to_enable
44+
projects_to_enable = local.projects_to_enable
45+
gitlab_agent_append_to_config_file = var.gitlab_agent_append_to_config_file
46+
gitlab_agent_grant_user_access_to_root_namespace = var.gitlab_agent_grant_user_access_to_root_namespace
47+
})
5848

5949
# Gitlab Agent CI/CD variables
6050
gitlab_agent_kubernetes_context_variables = {

variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ variable "operate_at_root_group_level" {
3737
default = true
3838
}
3939

40+
variable "gitlab_agent_grant_user_access_to_root_namespace" {
41+
description = "Grant `user_access` to the root namespace."
42+
type = bool
43+
default = false
44+
}
45+
4046
variable "groups_enabled" {
4147
description = "List of group paths where the GitLab Agent should be enabled. Only used when operate_at_root_group_level is false. If empty and projects_enabled is also empty, the parent group of the agent project will be used automatically."
4248
type = list(string)
@@ -50,14 +56,14 @@ variable "projects_enabled" {
5056
}
5157

5258
variable "gitlab_agent_append_to_config_file" {
53-
description = "Append the Gitlab Agent configuration to the configuration file created for the entire root namespace. This variable is only used when `gitlab_agent_grant_access_to_entire_root_namespace` is true."
59+
description = "Append custom configuration to the Gitlab Agent configuration file. This content will be added at the end of the generated configuration."
5460
type = string
5561
default = ""
5662

5763
}
5864

5965
variable "gitlab_agent_custom_config_file_content" {
60-
description = "The content of the Gitlab Agent configuration file. If not provided and `gitlab_agent_grant_access_to_entire_root_namespace` is true, the default configuration file will be used and the root namespace will be granted access to the Gitlab Agent. If you set this variable, it takes precedence over `gitlab_agent_grant_access_to_entire_root_namespace`."
66+
description = "The content of the Gitlab Agent configuration file. If not provided, the default configuration file will be generated based on `operate_at_root_group_level`, `groups_enabled`, and `projects_enabled`. If you set this variable, it takes precedence over the automatic configuration generation."
6167
type = string
6268
default = ""
6369
}

0 commit comments

Comments
 (0)