I found this blockinfile problem where the user suggested adding a number after "|" in "block: |" line, but gives a syntax error. Basically, I want to use the blockinfile module to add a block of lines to a file, but I want the block to be indented with 6 spaces in the file. Here is the task
- name: Added a block of lines in the file blockinfile: dest: /path/some_file.yml insertafter: 'authc:' block: | line0 line1 line2 line3 line4
I expect
authc: line0 line1 line2 line3 line4
but get
authc: line0 line1 line2 line3 line4
Adding spaces to the beginning of lines is not performed. How can i do this?
source share