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 -
pull/20564/head
Craig Francis 8 years ago committed by John R Barker
parent 5d9dd5934a
commit 3e003b10fa

@ -126,6 +126,12 @@ EXAMPLES = r"""
address 192.0.2.23 address 192.0.2.23
netmask 255.255.255.0 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 - name: insert/update HTML surrounded by custom markers after <body> line
blockinfile: blockinfile:
path: /var/www/html/index.html path: /var/www/html/index.html

Loading…
Cancel
Save