added docs to blockinfile with_ interactions

fixes #1592
This commit is contained in:
Brian Coca 2016-02-24 08:39:53 -05:00 committed by Matt Clay
parent 0670a6c56d
commit 88c946ba4d

View file

@ -38,6 +38,7 @@ description:
surrounded by customizable marker lines. surrounded by customizable marker lines.
notes: notes:
- This module supports check mode. - This module supports check mode.
- When using 'with_' loops be aware that if you do not set a unique mark the block will be overwritten on each iteration.
options: options:
dest: dest:
aliases: [ name, destfile ] aliases: [ name, destfile ]
@ -136,6 +137,17 @@ EXAMPLES = r"""
dest: /var/www/html/index.html dest: /var/www/html/index.html
marker: "<!-- {mark} ANSIBLE MANAGED BLOCK -->" marker: "<!-- {mark} ANSIBLE MANAGED BLOCK -->"
content: "" content: ""
- name: insert/update "Match User" configuation block in /etc/ssh/sshd_config
blockinfile:
dest: /etc/hosts
block: |
{{item.name}} {{item.ip}}
marker: "# {mark} ANSIBLE MANAGED BLOCK {{item.name}}"
with_items:
- { name: host1, ip: 10.10.1.10 }
- { name: host2, ip: 10.10.1.11 }
- { name: host3, ip: 10.10.1.12 }
""" """