Reminder that lookup(‘file’) can be used (#20649)

* Reminder that lookup(‘file’) can be used

Sometimes the block of text does not easily fit into a playbook, so this acts as a reminder (or a prompt for anyone who hasn't used this before) that the content could be stored in an separate file.

I've also included `backup: yes` as I think this is a good example of where a backup might be needed.

* Correct the not so "smart quotes"

* Update blockinfile.py

Replace – with an an ASCII -
This commit is contained in:
Craig Francis 2017-02-07 13:57:49 +00:00 committed by John R Barker
parent 5d9dd5934a
commit 3e003b10fa

View file

@ -126,6 +126,12 @@ EXAMPLES = r"""
address 192.0.2.23
netmask 255.255.255.0
- name: insert/update configuration using a local file
blockinfile:
block: "{{ lookup('file', './local/ssh_config') }}"
dest: "/etc/ssh/ssh_config"
backup: yes
- name: insert/update HTML surrounded by custom markers after <body> line
blockinfile:
path: /var/www/html/index.html