我知道我可以打印STD出使用debug模塊Ansible的象下面這樣: ---
- hosts: all
tasks:
- name: list files under /root folder
command: ls /root
register: out
- name: stdout
debug: var=out.stdout_l
我發現這個blockinfile issue,其中一個用戶建議在「|」之後添加一個數字,在「塊:|」行,但給出了語法錯誤。基本上,我想使用blockinfile模塊在文件中添加一行代碼塊,但我希望該代碼塊在文件中縮進6個空格。這裏的任務 - name: Added a block of lines in the file
blockinfile:
dest: /path/som