【发布时间】:2015-09-11 22:32:39
【问题描述】:
在我的 Ansible 脚本中,我使用循环向来宾操作系统上的 apache2.conf 文件添加行。 lineinfile 模块插入除最后一行</Directory> 之外的每一行。为什么 Ansible 会跳过最后一行?谢谢。
- name: test
lineinfile:
dest: /etc/apache2/apache2.conf
line: "{{ item.line }}"
with_items:
- { line: <Directory /vagrant> }
- { line: Options Indexes FollowSymLinks }
- { line: AllowOverride All }
- { line: Require all granted }
- { line: </Directory> }
notify:
- restart apache2
【问题讨论】:
标签: apache2 vagrant ubuntu-14.04 ansible