Skip to content

Commit 0bb174f

Browse files
committed
Fix spec indentation in cluster.yml
The spec dictionary was badly indented when templating cluster.yml, because to_nice_yaml does not take into account the initial indentation required. The result would like like this: spec: key1: value1 key2: value2 key3: value3 Fix by passing the whole spec key and value into to_nice_yaml. Also set indent parameter to 2 spaces to match the rest of the file.
1 parent 380ad04 commit 0bb174f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

roles/cephadm/templates/cluster.yml.j2

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ networks:
5959
{% endif %}
6060
{% endif %}
6161
{% if service.spec is defined %}
62-
spec:
63-
{{ service.spec | to_nice_yaml }}
62+
{{ {"spec": service.spec} | to_nice_yaml(indent=2) }}
6463
{% endif %}
6564
{% endfor %}
6665
{% endif %}
@@ -72,6 +71,6 @@ service_id: {{ service.id }}
7271
placement:
7372
label: ingress
7473
spec:
75-
{{ service.spec | to_nice_yaml }}
74+
{{ {"spec": service.spec} | to_nice_yaml(indent=2) }}
7675
{% endfor %}
7776
{% endif %}

0 commit comments

Comments
 (0)