ansible-role-blockinfile
ansible-role-blockinfile copied to clipboard
blockinfile with_items
Hello, I have hard time to figure out how to get the blocks properly formatted.
With the task
- name: Configure Direcotries in {{apache_conf_path}}/httpd.conf
blockinfile:
dest: "{{apache_conf_path}}/httpd.conf"
backup: "yes"
marker: "# {mark} ANSIBLE MANAGED BLOCK"
insertafter: "# <Directory> blocks below."
block: |
{{item}}
with_items: "{{apache_Directory_blocks}}"
and variable
apache_Directory_blocks:
- <Directory "/usr/local/www/roundcube">
Options Indexes FollowSymLinks
</Directory>
I see the the block in one line
<Directory "/usr/local/www/roundcube"> Options Indexes FollowSymLinks </Directory>
What am I missing? Thank you for your effort!
-vlado