ansible-role-blockinfile icon indicating copy to clipboard operation
ansible-role-blockinfile copied to clipboard

blockinfile with_items

Open vbotka opened this issue 7 years ago • 1 comments

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

vbotka avatar Sep 12 '16 11:09 vbotka