Skip to content

Commit 7f0bec5

Browse files
authored
Merge pull request #467 from tobiashuste/monitoring-whitelist
Make monitoring whitelist variable configurable
2 parents 33042b0 + 6ac999f commit 7f0bec5

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

roles/gitlab/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,15 @@ gitlab_postgresql_db_password: 'changeme'
392392

393393
**Caution: You have to use your own private and encrypted password here.**
394394

395+
#### Configure monitoring whitelist for Gitlab rails
396+
397+
Configure the monitoring whitelist for GitLab-Rails:
398+
399+
```yaml
400+
gitlab_rails_monitoring_whitelist:
401+
- "{{ gitlab_ip_range }}"
402+
```
403+
395404
#### Configure GitLab Registry
396405

397406
Enable GitLab container registry:

roles/gitlab/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ gitlab_mattermost_only_context: "false"
9595

9696
gitlab_feature_flags: []
9797

98+
# List of IP addresses or IP ranges that are allowed to access monitoring endpoints
99+
gitlab_rails_monitoring_whitelist:
100+
- "{{ gitlab_ip_range }}"
98101
# Internal variable to determine whether the configuration object for Gitaly
99102
# is already present in gitlab_additional_configurations
100103
__gitaly_configuration_exists: false

roles/gitlab/templates/gitlab.rb.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ gitlab_rails['redis_sentinels'] = [
2828
gitlab_rails['redis_sentinels_password'] = "{{ gitlab_redis_sentinel_password }}"
2929
{% endif %}
3030
{% endif %}
31-
gitlab_rails['monitoring_whitelist'] = ["{{ gitlab_ip_range }}"]
31+
gitlab_rails['monitoring_whitelist'] = [{{ gitlab_rails_monitoring_whitelist | map('to_json') | join(', ') }}]
3232

3333
{% if gitlab_use_internal_gitaly %}
3434
{% if not __gitaly_configuration_exists %}

0 commit comments

Comments
 (0)