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:
parent
5d9dd5934a
commit
3e003b10fa
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue