Improve ansible yaml output for humans

We use ansible's to_nice_yaml output filter when writing ansible
datastructures to yaml. This has a default indent of 4, but we humans
usually write yaml with an indent of 2. Make the generated yaml more
similar to what us humans write and set the indent to 2.

Change-Id: I3dc41b54e1b6480d7085261bc37c419009ef5ba7
This commit is contained in:
Clark Boylan 2020-06-18 10:02:11 -07:00
parent bec4b57d81
commit f7e92ee669
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@
- name: Write nodepool config
copy:
content: "{{ nodepool_config | to_nice_yaml }}"
content: "{{ nodepool_config | to_nice_yaml(indent=2) }}"
dest: /etc/nodepool/nodepool.yaml
- name: Symlink in elements from project-config repo

View File

@ -103,7 +103,7 @@
# otherwise throws a j2 formatting exception.
- name: Write out testinfra extra data fixture
copy:
content: "{{ testinfra_extra_data | default('') | to_nice_yaml }}"
content: "{{ testinfra_extra_data | default('') | to_nice_yaml(indent=2) }}"
dest: '/home/zuul/testinfra_extra_data_fixture.yaml'
- name: Run testinfra to validate configuration