Closed o0-o closed 1 year ago
I have the following in an ansible task:
- block: ... - name: Save egress interface to host_vars yedit: src: "{{ inventory_dir }}/host_vars/{{ inventory_hostname }}.yml" key: egress.iface value: "{{ egress['iface'] }}" delegate_to: 127.0.0.1
The key/value is added properly, but the --- at the beginning of the src file disappears. I have confirmed this by copying the file immediately before and after this runs as well as with the built in backup option.
---
I have the following in an ansible task:
The key/value is added properly, but the
---
at the beginning of the src file disappears. I have confirmed this by copying the file immediately before and after this runs as well as with the built in backup option.