diff --git a/playbooks/roles/gerrit/templates/docker-compose.yaml.j2 b/playbooks/roles/gerrit/templates/docker-compose.yaml.j2
index 7b8569c975..8c814217fc 100644
--- a/playbooks/roles/gerrit/templates/docker-compose.yaml.j2
+++ b/playbooks/roles/gerrit/templates/docker-compose.yaml.j2
@@ -1,7 +1,6 @@
 version: '2'
-
-{% if gerrit_reviewdb_database_type == 'mariadb_container' %}
 services:
+{% if gerrit_reviewdb_database_type == 'mariadb_container' %}
   mariadb:
     image: docker.io/library/mariadb:10.4
     network_mode: host