Skip to content

Make monitoring whitelist variable configurable #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions roles/gitlab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,15 @@ gitlab_postgresql_db_password: 'changeme'

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

#### Configure monitoring whitelist for Gitlab rails

Configure the monitoring whitelist for GitLab-Rails:

```yaml
gitlab_rails_monitoring_whitelist:
- "{{ gitlab_ip_range }}"
```

#### Configure GitLab Registry

Enable GitLab container registry:
Expand Down
3 changes: 3 additions & 0 deletions roles/gitlab/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ gitlab_mattermost_only_context: "false"

gitlab_feature_flags: []

# List of IP addresses or IP ranges that are allowed to access monitoring endpoints
gitlab_rails_monitoring_whitelist:
- "{{ gitlab_ip_range }}"
# Internal variable to determine whether the configuration object for Gitaly
# is already present in gitlab_additional_configurations
__gitaly_configuration_exists: false
Expand Down
2 changes: 1 addition & 1 deletion roles/gitlab/templates/gitlab.rb.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ gitlab_rails['redis_sentinels'] = [
gitlab_rails['redis_sentinels_password'] = "{{ gitlab_redis_sentinel_password }}"
{% endif %}
{% endif %}
gitlab_rails['monitoring_whitelist'] = ["{{ gitlab_ip_range }}"]
gitlab_rails['monitoring_whitelist'] = [{{ gitlab_rails_monitoring_whitelist | map('to_json') | join(', ') }}]

{% if gitlab_use_internal_gitaly %}
{% if not __gitaly_configuration_exists %}
Expand Down