Skip to content

Project settings

Configuring project settings

gitlab_settings_projects is a list of project entries keyed by full path. Each entry can manage the project's own attributes plus its hooks, push rules, protected branches and tags, merge-request approvals, and custom attributes. A case-insensitive duplicate path across entries is a named planning failure — collection values are never merged or overwritten.

GitLab's project API accepts either a numeric ID or a URL-encoded full path in its {id} path parameter. The declared full path is percent-encoded as one path segment.

Projects are created from their declarations

A declared project that does not exist is created: the last path segment becomes its path and name, and the namespace half of the full path is resolved through the API (a group or user namespace; create a missing group first — declaration order is the dependency order, and one apply with gitlab_settings_resource: all can create the group hierarchy and the project together). A project and all of its children — hooks, members, variables, labels, shares, protected refs, environments, pipeline schedules and their variables — apply together in one run: each child records a dependency on its container's create operation, which the write gate's check-mode preflight accepts in place of live state.

An entry may declare state: absent — alone; an absent container cannot also declare settings or children — and the public gitlab_settings task offers the same via resource: project with state: absent. Deletion removes the project and its repository, so treat it with the care it deserves. A bare entry still creates the project when it is missing, and a declared name wins over the derived last path segment. On instances with delayed deletion, GitLab marks the project and frees its path by renaming it; the old path's route-history redirect is treated as absence, so repeating the deletion is idempotent and the path is immediately reusable by a new declaration.

Example project definition

gitlab_settings_projects:
  - path: platform/engineering/service
    project:
      visibility: private
      description: Payment service
    merge_requests:
      merge_method: ff
      only_allow_merge_if_pipeline_succeeds: true
    hooks:
      - name: service-events
        url: https://hooks.example.com/gitlab/projects/service
        push_events: true
        pipeline_events: true
    push_rules:
      reject_unsigned_commits: true
      reject_non_dco_commits: true
    protected_branches:
      - name: main
        allowed_to_push:
          - access_level: maintainer
        allowed_to_merge:
          - access_level: developer
    protected_tags:
      - name: "v*"
        allowed_to_create:
          - access_level: maintainer
    approvals:
      settings:
        allow_author_approval: false
        allow_committer_approval: false
      rules:
        - name: security-review
          approvals_required: 2
    custom_attributes:
      managed_by: ansible

Project Entry Spec

GitLab API reference

GitLab's API documentation defines the project attribute fields:

  1. Projects API — edit project
  2. Project push rules
  3. Protected branches API
  4. Protected tags API
  5. MR approvals API

The setting objects below are organizational sections. Their scalar properties are flattened into one PUT /projects/:id request, so declare each property in only one section. The fields below describe the scalar properties accepted by GitLab's project-edit endpoint; the section placement is the recommended grouping used throughout these examples.

Structured GitLab project-edit properties

GitLab also defines the following object and array properties. They are listed separately from the scalar organizational sections below.

container_expiration_policy_attributesobject

Container image cleanup-policy settings.

Properties of container_expiration_policy_attributes

cadencestring

How often the recurring cleanup job runs.


keep_ninteger

Number of images to retain.


older_thanstring

Remove images older than this duration.


name_regexstring

Regular expression selecting image names for removal.


name_regex_keepstring

Regular expression selecting image names to retain.


enabledboolean

Enable or disable the container image cleanup policy.


ci_id_token_sub_claim_componentsarray of strings

Claims used to construct the sub claim in CI/CD ID tokens.


topicsarray of strings

Topics assigned to the project.

pathstringRequired

Full path of the project, including its group hierarchy.

Example:
gitlab_settings_projects:
  - path: platform/engineering/service
...

projectobject

Visibility, description, and general project attributes. Scalar keys flatten into the project update.

Properties of project

namestring

Display name of the project.


pathstring

URL path of the project. The entry's top-level path remains the lookup identity for the current run.


descriptionstring

Description shown on the project's overview page.


visibilitystring

Can be one of: private, internal, public.


avatarstring (binary file)

Avatar image uploaded for the project.


emails_enabledboolean

Enable project email notifications.


show_default_award_emojisboolean

Show GitLab's default award emojis.


warn_about_potentially_unwanted_charactersboolean

Warn users about potentially unwanted Unicode characters.


request_access_enabledboolean

Allow users to request membership in the project.

Example:
gitlab_settings_projects:
  - path: platform/service
    project:
      visibility: private
...

featuresobject

Project feature access levels. Scalar keys flatten into the project update.

Properties of features

 Access-level properties can be disabled, private, or enabled.

issues_enabledboolean

Enable the issue tracker using the legacy boolean control.


merge_requests_enabledboolean

Enable merge requests using the legacy boolean control.


wiki_enabledboolean

Enable the project wiki using the legacy boolean control.


jobs_enabledboolean

Enable CI/CD jobs using the legacy boolean control.


snippets_enabledboolean

Enable project snippets using the legacy boolean control.


issues_access_levelstring

Issue tracker access level.


merge_requests_access_levelstring

Merge-request access level.


snippets_access_levelstring

Project-snippet access level.


wiki_access_levelstring

Project-wiki access level.


releases_access_levelstring

Release access level.


builds_access_levelstring

CI/CD build access level.


analytics_access_levelstring

Analytics access level.


environments_access_levelstring

Environment access level.


feature_flags_access_levelstring

Feature-flag access level.


infrastructure_access_levelstring

Infrastructure access level.


monitor_access_levelstring

Monitoring access level.


model_experiments_access_levelstring

Model experiment access level.


model_registry_access_levelstring

Model registry access level.


requirements_access_levelstring

Requirements feature access level.


pages_access_levelstring

GitLab Pages access. Unlike the other access-level properties, this also accepts public. Other Pages controls use the dedicated projects[].pages surface in Integrations and Services.


duo_remote_flows_enabledboolean

Enable GitLab Duo remote flows.


duo_sast_fp_detection_enabledboolean

Enable GitLab Duo SAST false-positive detection.


duo_secret_detection_fp_enabledboolean

Enable GitLab Duo Secret Detection false-positive detection.


duo_dependency_bump_breaking_changes_enabledboolean

Enable Agentic Breaking Change Resolution for dependency updates.


duo_sast_vr_workflow_enabledboolean

Enable the GitLab Duo SAST vulnerability-resolution workflow.

Example:
gitlab_settings_projects:
  - path: platform/service
    features:
      issues_access_level: enabled
...

merge_requestsobject

Merge methods and merge-request policy. Scalar keys flatten into the project update.

Properties of merge_requests

merge_methodstring

Can be one of: ff, rebase_merge, merge.


squash_optionstring

Squash behavior. Can be one of: never, always, default_on, default_off.


remove_source_branch_after_mergeboolean

Select source-branch removal by default after merge.


resolve_outdated_diff_discussionsboolean

Automatically resolve diff discussions whose lines change in a later push.


only_allow_merge_if_pipeline_succeedsboolean

Require a successful pipeline before merging.


allow_merge_on_skipped_pipelineboolean

Treat a skipped pipeline as satisfying the successful-pipeline requirement.


only_allow_merge_if_all_discussions_are_resolvedboolean

Require every discussion to be resolved before merging.


only_allow_merge_if_all_status_checks_passedboolean

Require every external status check to pass before merging.


printing_merge_request_link_enabledboolean

Show a merge-request create/view link after a Git push.


show_diff_preview_in_emailboolean

Include code-diff previews in merge-request notification emails.


suggestion_commit_messagestring

Commit message used when applying merge-request suggestions.


merge_commit_templatestring

Template used to create merge commit messages.


squash_commit_templatestring

Template used to create squash commit messages.


issue_branch_templatestring

Template used to name branches created from issues.


issues_templatestring

Default GitLab Flavored Markdown description for new issues.


merge_requests_templatestring

Default GitLab Flavored Markdown description for new merge requests.


autoclose_referenced_issuesboolean

Close referenced issues automatically when changes reach the default branch.


mr_default_title_templatestring

Template used for default merge-request titles.


merge_request_title_regexstring

Regular expression that merge-request titles must match.


merge_request_title_regex_descriptionstring

User-facing explanation of the merge-request title rule.


approvals_before_mergeinteger

Legacy default number of approvals required before merge.


fallback_approvals_requiredinteger

Approvals required when no approval rule applies.


prevent_merge_without_jira_issueboolean

Require an associated Jira issue before merging.


auto_duo_code_review_enabledboolean

Automatically request a GitLab Duo review on merge requests.


merge_pipelines_enabledboolean

Enable merged-results pipelines.


merge_trains_enabledboolean

Enable merge trains.


merge_trains_skip_train_allowedboolean

Allow a merge-train merge request to merge without waiting for its train pipeline.


merge_train_enforcementstring

Can be one of: allow_bypass, enforce_for_all_users, enforce_with_owner_override.


max_pipelines_per_merge_traininteger

Maximum parallel pipelines in the project's merge train.


security_policy_pipeline_must_succeedboolean

Require every security-policy pipeline to succeed before merging.


reviewer_assignment_strategystring

Automatic reviewer strategy. Can be one of: disabled, code_owners, dap_powered.

Example:
gitlab_settings_projects:
  - path: platform/service
    merge_requests:
      merge_method: ff
...

repositoryobject

Repository behavior. Scalar keys flatten into the project update.

Properties of repository

default_branchstring

Default branch of the project.


lfs_enabledboolean

Enable Git Large File Storage for the repository.


repository_access_levelstring

Repository access. Can be one of: disabled, private, enabled.


repository_storagestring

Storage shard that hosts the repository. Administrator-only.


import_urlstring

URL from which GitLab imports repository content.


web_based_commit_signing_enabledboolean

Sign commits created through the GitLab web interface.

Example:
gitlab_settings_projects:
  - path: platform/service
    repository:
      lfs_enabled: true
...

ci_cdobject

Pipeline and runner policy. Scalar keys flatten into the project update.

Properties of ci_cd

build_git_strategystring

Runner checkout strategy. Can be one of: fetch, clone.


build_timeoutinteger

Job timeout in seconds.


auto_cancel_pending_pipelinesstring

Auto-cancel redundant pending pipelines. Can be one of: disabled, enabled.


ci_config_pathstring

Path or external location of the CI/CD configuration file.


public_jobsboolean

Allow non-members to view public pipelines and jobs.


shared_runners_enabledboolean

Enable instance runners for the project.


group_runners_enabledboolean

Enable group runners for the project.


resource_group_default_process_modestring

Default resource-group queue mode. Can be one of: unordered, oldest_first, newest_first, newest_ready_first.


auto_devops_enabledboolean

Enable Auto DevOps.


auto_devops_deploy_strategystring

Auto Deploy strategy. Can be one of: continuous, manual, timed_incremental.


ci_default_git_depthinteger

Default shallow-clone depth for CI/CD jobs.


keep_latest_artifactboolean

Keep artifacts from the latest successful job on each ref.


ci_forward_deployment_enabledboolean

Prevent older, still-pending deployment jobs from running after a newer deployment.


ci_forward_deployment_rollback_allowedboolean

Allow retries of older deployment jobs for rollbacks.


ci_allow_fork_pipelines_to_run_in_parent_projectboolean

Allow fork merge-request pipelines to run in the parent project.


ci_separated_cachesboolean

Separate CI/CD caches according to branch protection.


restrict_user_defined_variablesboolean

Restrict user-defined variables supplied when a pipeline starts.


ci_pipeline_variables_minimum_override_rolestring

Minimum role allowed to override pipeline variables. Can be one of: no_one_allowed, developer, maintainer, owner.


ci_push_repository_for_job_token_allowedboolean

Allow this project's CI/CD job tokens to push to its repository.


ci_delete_pipelines_in_secondsinteger

Delete pipelines older than this many seconds.


max_artifacts_sizeinteger

Maximum size in megabytes for an individual job artifact.


protect_merge_request_pipelinesboolean

Make protected variables and runners available to merge-request pipelines.


ci_display_pipeline_variablesboolean

Display manually defined variables on pipeline details pages.


allow_pipeline_trigger_approve_deploymentboolean

Allow the pipeline triggerer to approve deployments.


ci_restrict_pipeline_cancellation_rolestring

Role policy controlling who may cancel pipelines and jobs.

Example:
gitlab_settings_projects:
  - path: platform/service
    ci_cd:
      build_timeout: 3600
...

packages_and_registryobject

Package and registry policy. Scalar keys flatten into the project update.

Properties of packages_and_registry

package_registry_access_levelstring

Package registry access. Can be one of: disabled, private, enabled, public.


container_registry_access_levelstring

Container registry access. Can be one of: disabled, private, enabled.

Example:
gitlab_settings_projects:
  - path: platform/service
    packages_and_registry:
      package_registry_access_level: enabled
...

service_deskobject

Service Desk settings. Scalar keys flatten into the project update.

Properties of service_desk

service_desk_enabledboolean

Enable Service Desk for the project.

Example:
gitlab_settings_projects:
  - path: platform/service
    service_desk:
      service_desk_enabled: false
...

forkingobject

Fork policy. Scalar keys flatten into the project update.

Properties of forking

forking_access_levelstring

Fork access. Can be one of: disabled, private, enabled.


mr_default_target_selfboolean

Make merge requests from this fork target the fork itself by default.

Example:
gitlab_settings_projects:
  - path: platform/service
    forking:
      forking_access_level: enabled
...

housekeepingobject

Reserved organizational section for future project housekeeping settings.

Properties of housekeeping

 GitLab's project-edit endpoint defines no housekeeping property.

Example: none — omit this section.

complianceobject

Project compliance attributes. Scalar keys flatten into the project update.

Properties of compliance

security_and_compliance_access_levelstring

Security and compliance feature access. Can be one of: disabled, private, enabled.


external_authorization_classification_labelstring

External authorization classification label assigned to the project.


enforce_auth_checks_on_uploadsboolean

Require authorization checks when users access uploaded files.


spp_repository_pipeline_accessboolean

Grant linked CI/CD projects read-only access to security-policy configuration.

Example:
gitlab_settings_projects:
  - path: platform/service
    compliance:
      security_and_compliance_access_level: private
...

hooksarray of objects

Project webhooks. Same schema and lifecycle as System Hooks, including write-only secrets, url_variables, and custom_headers.

Properties of hooks

idinteger

Optional lookup-only identity for one existing hook.


namestring

Preferred hook identity. When id is omitted, declare name or url.


urlstringRequired on create

Private destination URL and fallback identity.


descriptionstring


statestring

Can be one of: present, absent. Default: present.


tokenstring

Write-only shared secret.


signing_tokenstring

Write-only HMAC signing secret in GitLab's whsec_* format.


force_secret_updateboolean

Rewrite declared secrets even when no readable property drifted.


enable_ssl_verificationboolean


push_eventsboolean


push_events_branch_filterstring


branch_filter_strategystring

Can be one of: wildcard, regex, all_branches.


issues_eventsboolean


confidential_issues_eventsboolean


merge_requests_eventsboolean


tag_push_eventsboolean


note_eventsboolean


confidential_note_eventsboolean


job_eventsboolean


pipeline_eventsboolean


wiki_page_eventsboolean


deployment_eventsboolean


feature_flag_eventsboolean


releases_eventsboolean


milestone_eventsboolean


emoji_eventsboolean


resource_access_token_eventsboolean


resource_deploy_token_eventsboolean


vulnerability_eventsboolean


custom_webhook_templatestring


url_variablesobject or array

Write-only URL variables in map form, map-with-state form, or {key, value, state} list form.

Properties of each url_variables entry

keystringRequired in list form

Child identity. In map form, the map key supplies it.


valuestringRequired when state is present

Write-only value. It is required when this entry's state is present (the default). Omit it when state: absent; deletion uses the entry's key.


force_secret_updateboolean

Rewrite the value when no readable child attribute drifted. Default: false.


statestring

Can be one of: present, absent. Default: present.


custom_headersobject or array

Write-only custom headers in map form, map-with-state form, or {key, value, state} list form.

Properties of each custom_headers entry

keystringRequired in list form

Child identity. In map form, the map key supplies it.


valuestringRequired when state is present

Write-only value. It is required when this entry's state is present (the default). Omit it when state: absent; deletion uses the entry's key.


force_secret_updateboolean

Rewrite the value when no readable child attribute drifted. Default: false.


statestring

Can be one of: present, absent. Default: present.

Example:
gitlab_settings_projects:
  - path: platform/service
    hooks:
      - name: service-events
        url: https://hooks.example.com/gitlab/projects/service
        pipeline_events: true
...

push_rulesobject

The project's singleton push rule; same semantics and fields as the group form in Group Settings, including state: absent.

Properties of push_rules

author_email_regexstring

Regular expression that commit author email addresses must match.


branch_name_regexstring

Regular expression that branch names must match.


commit_committer_checkboolean

Require the committer to be a GitLab member.


commit_committer_name_checkboolean

Require the committer name to match the user's GitLab name.


commit_message_negative_regexstring

Reject commit messages matching this regular expression.


commit_message_regexstring

Require commit messages to match this regular expression.


deny_delete_tagboolean

Prevent users from deleting Git tags.


file_name_regexstring

Reject files whose paths match this regular expression.


max_file_sizeinteger

Maximum size in megabytes for a pushed file; 0 disables the limit.


member_checkboolean

Restrict pushes to verified GitLab users.


prevent_secretsboolean

Reject commits that GitLab detects as containing secrets.


reject_non_dco_commitsboolean

Reject commits without a Developer Certificate of Origin sign-off.


reject_unsigned_commitsboolean

Reject commits without a verified cryptographic signature.


statestring

Can be one of: present, absent. Default: present.

Example:
gitlab_settings_projects:
  - path: platform/service
    push_rules:
      reject_unsigned_commits: true
      reject_non_dco_commits: true
...

protected_branchesarray of objects

Protected branch rules matched by name. Entry schema, access levels, and the access-array caveat are documented in Group Settings. Project-level rules support in-place scalar updates (via PATCH) on both backends' API path; the Rails backend creates missing rules and treats existing ones as in sync.

Properties of protected_branches

namestringRequired

Branch name or wildcard and rule identity.


allowed_to_pusharray of objects

Push access entries of {access_level: <level>}.


allowed_to_mergearray of objects

Merge access entries of {access_level: <level>}.


allowed_to_unprotectarray of objects

Access entries allowed to unprotect the branch.

Properties of each protected-branch access entry

access_levelstring or integerRequired

Can be one of: no_access (0), guest (10), reporter (20), developer (30), maintainer (40), owner (50), admin (60). Unknown names fail planning.


allow_force_pushboolean


code_owner_approval_requiredboolean


statestring

Can be one of: present, absent. Default: present.

Example:
gitlab_settings_projects:
  - path: platform/service
    protected_branches:
      - name: main
        allowed_to_push:
          - access_level: maintainer
        code_owner_approval_required: true
...

protected_tagsarray of objects

Protected tag rules matched by name, including wildcard names.

Properties of protected_tags

namestringRequired

Tag name or wildcard and rule identity.


allowed_to_createarray of objects

Access entries allowed to create matching tags.

Properties of each allowed_to_create entry

access_levelstring or integerRequired

Can be one of: no_access (0), guest (10), reporter (20), developer (30), maintainer (40), owner (50), admin (60). Unknown names fail planning.


statestring

Can be one of: present, absent. Default: present

Note: GitLab cannot update a protected tag in place; drift on an existing rule fails in strict mode and is recorded as a skip in compatible mode. Remove and re-add the rule to change it.

Example:
gitlab_settings_projects:
  - path: platform/service
    protected_tags:
      - name: "v*"
        allowed_to_create:
          - access_level: maintainer
...

approvalsobject

Merge-request approval configuration. Requires the api backend; selecting Rails fails in strict mode or records skips in compatible mode.

Properties of approvals

settingsobject

Project-wide merge-request approval settings.

Properties of approvals.settings

allow_author_approvalboolean


allow_committer_approvalboolean


allow_overrides_to_approver_list_per_merge_requestboolean


require_password_to_approveboolean


require_reauthentication_to_approveboolean


retain_approvals_on_pushboolean


selective_code_owner_removalsboolean


rulesarray of objects

Approval rules matched by name. Scalar fields reconcile with drift detection; approver arrays apply on create but are excluded from drift detection.

Properties of approvals.rules

namestringRequired


approvals_requiredintegerRequired on create


applies_to_all_protected_branchesboolean


coverage_minimum_thresholdnumber


report_typestring


rule_typestring


scannersarray of strings


severity_levelsarray of strings


user_idsarray of integers

Applied on create and excluded from drift detection.


usernamesarray of strings


group_idsarray of integers

Applied on create and excluded from drift detection.


protected_branch_idsarray of integers

Applied on create and excluded from drift detection.


vulnerabilities_allowedinteger


vulnerability_statesarray of strings

Example:
gitlab_settings_projects:
  - path: platform/service
    approvals:
      settings:
        allow_author_approval: false
      rules:
        - name: security-review
          approvals_required: 2
...

custom_attributesobject

Custom attribute key/value pairs; same semantics as the group form.

Properties of custom_attributes

<attribute name>string

The map key is the custom-attribute identity; the value must be bounded text.

Example:
gitlab_settings_projects:
  - path: platform/service
    custom_attributes:
      managed_by: ansible
...

external_status_checksarray of objects

External status check services that merge requests must pass, matched by name.

Properties of external_status_checks

namestringRequired

Service name and identity.


external_urlstringRequired on create

Service URL; reconciles by private fingerprint.


protected_branch_idsarray of integers

Protected branches to which the service applies; reconciles with drift detection.


shared_secretstring

Write-only secret carried on every write and never displayed or diffed.


statestring

Can be one of: present, absent. Default: present

Example:
gitlab_settings_projects:
  - path: platform/service
    external_status_checks:
      - name: compliance-gate
        external_url: https://checks.example.com/gitlab
        shared_secret: "{{ vault_status_check_secret }}"
...

feature_flagsarray of objects

Project feature flags matched by name. GitLab sets version on create; it is not managed.

Properties of feature_flags

namestringRequired

Feature-flag name and identity.


activeboolean

Desired live state; reconciles with drift detection.


descriptionstring

Feature-flag description; reconciles with drift detection.


strategiesarray of objects

Nested rollout configuration. Applied on create and not compared or updated afterward.

Properties of each strategies entry

namestringRequired

Can be one of: default, gradualRolloutUserId, userWithId, gitlabUserList, flexibleRollout.


parametersobject

Strategy-specific string parameters.

Common properties of parameters

percentagestring

 Rollout percentage used by gradual or flexible rollout strategies.


group_idstring

 Group identifier used by the gradual rollout strategy.


userIdsstring

 Comma-separated user IDs used by the user-targeting strategy.


user_list_idinteger

Feature-flag user-list ID for the gitlabUserList strategy.


scopesarray of objects

Environment scopes in which the strategy applies.

Properties of each strategies[].scopes entry

environment_scopestringRequired

 Environment name or wildcard matched by this scope.


statestring

Can be one of: present, absent. Default: present

Note — declared state wins: a declared active value is applied on every run and overwrites live toggles made in the UI. This is the project feature-flag surface, distinct from the instance features gates.

Example:
gitlab_settings_projects:
  - path: platform/service
    feature_flags:
      - name: beta_ui
        active: true
        description: Roll out the redesigned UI
        strategies:
          - name: gradualRolloutUserId
            parameters:
              percentage: "25"
              group_id: default
...

security_policiesobject

The project's security policies as one document. This surface is GraphQL-only (backends: [graphql]) and converge-only: the project must already be linked to a Security Policy Project. Idempotence is by parsed policy name within each array, so reordering and whitespace never trigger a commit; per-policy state: absent prunes that policy.

Properties of security_policies

scan_execution_policyarray of policy objects

Policies that run security scanners on schedules or other declared conditions.


pipeline_execution_policyarray of policy objects

Policies that inject or enforce CI/CD pipeline configuration.


pipeline_execution_schedule_policyarray of policy objects

Policies that schedule execution of security-policy pipelines.


vulnerability_management_policyarray of policy objects

Policies that automate vulnerability-management actions.


approval_policyarray of policy objects

Generates report_approver rules; this is distinct from classic approvals.rules.

Common properties of each security-policy object

namestringRequired

Policy identity. Names must be unique within their parent policy array.


statestring

Lifecycle state. Can be one of: present, absent. Default: present.


typestring

Optional explicit type. When declared, it must exactly equal the parent array name.


enabled, rules, actions, and other policy-specific keysYAML values

Every string-keyed policy field and nested value is preserved, then GitLab validates the fields for the selected policy type. Null values are omitted; aliases, duplicate keys, non-string keys, and declarations beyond the documented size, depth, and node budgets fail before mutation.

An existing linked Security Policy Project is required; this surface does not create that link.

Ownership modes: the default (mode: replace) is a full-replace targetpolicies authored outside this declaration in the same .gitlab/security-policies/policy.yml are pruned, and an undeclared policy array is emptied; declare every policy you want to keep. mode: merge co-owns the document instead: foreign policies and undeclared arrays are preserved, removal happens only through a per-policy state: absent, and the diff reports managed names only (mode: merge cannot combine with document-level state: absent). In both modes GitLab accepts exactly one named policy per commit mutation, so each changed policy uses one APPEND, REPLACE, or REMOVE. These mutations are sequential, not transactional: a later failure can leave earlier changes applied, and a corrected rerun converges the remainder.

Note — async propagation and normalization: real GitLab does not reflect a policy commit immediately (~10 minutes), so a second run against a live instance may still report drift until propagation completes. Idempotence is verified offline; against a live instance, GitLab may also normalize or inject defaults into stored policies, so treat repeated no-op runs as best-effort until confirmed on your instance. A malformed declaration (a mapping instead of a list of policies, an entry with no name, a duplicate name, or a conflicting type) fails the run loudly before any mutation rather than silently pruning.

The classic per-project MR approval rules managed over REST (approvals.rules) are a different feature from approval_policy here, which generates report_approver rules; avoid managing overlapping approval configuration through both.

Example:
gitlab_settings_projects:
  - path: platform/service
    security_policies:
      scan_execution_policy:
        - name: nightly-sast
          enabled: true
          rules:
            - type: schedule
              cadence: "0 2 * * *"
          actions:
            - scan: sast
      approval_policy:
        - name: require-security-approval
          enabled: true
...

escalation_policiesarray of objects

Incident-management escalation policies managed through the GraphQL-only backend (backends: [graphql]). GitLab's nested response is normalized back to the flat declaration shape for exact second-run comparison.

Properties of escalation_policies

namestringRequired

Escalation-policy name and identity.


descriptionstring

Policy description; reconciles with drift detection.


rulesarray of objectsRequired on create

Ordered replace-all rule list.

Properties of escalation_policies[].rules

usernamestringRequired unless alternate target is set

Existing user target. Declare exactly one of username or oncall_schedule_iid.


oncall_schedule_iidstring or integerRequired unless alternate target is set

Explicitly known IID of an existing on-call schedule. A newly created schedule name is not translated to its server-assigned IID.


statusstringRequired

Target incident status, such as ACKNOWLEDGED or RESOLVED.


elapsed_time_secondsintegerRequired

Delay before this escalation rule applies.


statestring

Can be one of: present, absent. Default: present

Example:
gitlab_settings_projects:
  - path: platform/service
    escalation_policies:
      - name: primary-escalation
        rules:
          - username: oncall-engineer
            status: ACKNOWLEDGED
            elapsed_time_seconds: 300
...

runnersarray of objects

Project runners registered through the GitLab 16+ user-runner endpoint. The declared project is resolved to its numeric id automatically, the one-time authentication token is captured exactly once to token_file (mode 0600), and comparison reads the runner-detail endpoint. The convergence listing is scoped to this project and filtered to project_type, so inherited or shared runners are never claimed.

Properties of runners

descriptionstringRequired

Runner description and identity.


token_filestring

Absolute controller path capturing the one-time authentication token.


tag_listarray of strings


pausedboolean


lockedboolean


run_untaggedboolean


access_levelstring

Can be one of: not_protected, ref_protected.


maintenance_notestring


maximum_timeoutinteger


statestring

Can be one of: present, absent. Default: present

Example:
gitlab_settings_projects:
  - path: platform/service
    runners:
      - description: project-runner
        token_file: /var/lib/ansible/secrets/project-runner-token
        run_untagged: true
...

oncall_schedulesarray of objects

Incident-management on-call schedules managed through the GraphQL-only backend (backends: [graphql]). Declared rotation times compare in the schedule's timezone against GitLab's UTC timestamps.

Properties of oncall_schedules

namestringRequired

Schedule name and identity.


descriptionstring

Schedule description; reconciles with drift detection.


timezonestringRequired on create

IANA timezone; reconciles with drift detection.


rotationsarray of objects

Nested rotations matched by name. Their full configuration reconciles through create, update, and delete mutations.

Properties of oncall_schedules[].rotations

namestringRequired


starts_atobjectRequired on create

Required on create; local start timestamp in the schedule's timezone.

Properties of starts_at

datestring (date)Required

Calendar date in YYYY-MM-DD form.


timestring (time)Required

24-hour time in HH:MM form.


ends_atobject

Optional local end timestamp in the schedule's timezone.

Properties of ends_at

datestring (date)Required

Calendar date in YYYY-MM-DD form.


timestring (time)Required

24-hour time in HH:MM form.


rotation_lengthobjectRequired on create

Required on create; duration assigned to each participant before rotating.

Properties of rotation_length

lengthintegerRequired

Positive duration amount.


unitstringRequired

Can be one of: HOURS, DAYS, WEEKS.


active_periodobject

Optional daily active window.

Properties of active_period

start_timestring (time)Required

Window start in 24-hour HH:MM form.


end_timestring (time)Required

Window end in 24-hour HH:MM form.


participantsarray of objectsRequired on create

Required on create; the ordered list must contain between 1 and 100 unique usernames.

Properties of each participants entry

usernamestringRequired

Existing GitLab username. Duplicate usernames fail planning.


color_palettestring

GitLab display-color palette. The value is normalized to uppercase before submission. Default: blue.


color_weightstring or integer

GitLab display-color weight. A numeric value is normalized to WEIGHT_<value>. Default: 500.


statestring

Can be one of: present, absent. Default: present


statestring

Can be one of: present, absent. Default: present

Example:
gitlab_settings_projects:
  - path: platform/service
    oncall_schedules:
      - name: primary
        timezone: Etc/UTC
        rotations:
          - name: weekly
            starts_at: {date: "2026-01-01", time: "09:00"}
            rotation_length: {length: 1, unit: WEEKS}
            participants:
              - username: oncall-engineer
...

feature_flag_user_listsarray of objects

Named user lists that feature-flag strategies target. Lists are matched by name and routed for update and delete by their server-assigned iid.

Properties of feature_flag_user_lists

namestringRequired

User-list name and identity.


user_xidsstringRequired on create

Comma-separated external user ids; reconciles with drift detection.


statestring

Can be one of: present, absent. Default: present

Example:
gitlab_settings_projects:
  - path: platform/service
    feature_flag_user_lists:
      - name: beta_testers
        user_xids: "1001,1002,1003"
...

Deployment surfaces (environments, protected environments, deploy keys, pipeline schedules, registry/package/tag protection rules, freeze periods) are documented in Environments and Deployments.