ansible-role-blockinfile
ansible-role-blockinfile copied to clipboard
Spacing in blocks does not work as expected
- name: Add logstash-forwarder to datadog process monitoring
blockinfile:
dest: /etc/dd-agent/conf.d/process.yaml
block: |
- name: logstash-forwarder
search_string: ['logstash-forwarder']
exact_match: false
thresholds:
# critical if no server.py is running
critical: [1, 1]
this code for example will be aligned to the first line in the block. this means that the result in the yaml would be:
- name: logstash-forwarder
search_string: ['logstash-forwarder']
notice that spacing. the - name
is at the beginning of the line and search_string
is two spaces behind.
This breaks the yaml format and should be handled.