The goal seems to be simple, but I cannot manage to get the indentation
right.
*Playbook*:
- name: Saving a list of dictionaries to a file
gather_facts: false
hosts:
- localhost
strategy: debug
tasks:
- name: Saving a list of dictionaries to a file
vars:
volumes:
- class: 'data'
id: 'a61b96e7-427e-493a-993c-c3efc8a16aa1'
size: '500GB'
type: 'ssd'
template:
src: "volumes.j2"
dest: "../files/volumes.yml"
*Template*:
volumes:
{{ volumes | to_nice_yaml(indent=10) }}
*Result*:
volumes:
- class: data
id: a61b96e7-427e-493a-993c-c3efc8a16aa1
size: 500GB
type: ssd
*Expected result*:
volumes:
- class: data
id: a61b96e7-427e-493a-993c-c3efc8a16aa1
size: 500GB
type: ssd
What is strange is that the indent value has no effect on the result.
Am I doing something wrong or is this an issue with ansible?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/9147b9cf-c1ab-4102-905c-7f720c4401c0n%40googlegroups.com.