mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Add a validate example to blockinfile. (#32088)
This commit is contained in:
@@ -117,11 +117,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
|
- name: insert/update configuration using a local file and validate it
|
||||||
blockinfile:
|
blockinfile:
|
||||||
block: "{{ lookup('file', './local/ssh_config') }}"
|
block: "{{ lookup('file', './local/ssh_config') }}"
|
||||||
dest: "/etc/ssh/ssh_config"
|
dest: "/etc/ssh/ssh_config"
|
||||||
backup: yes
|
backup: yes
|
||||||
|
validate: "/usr/sbin/sshd -T -f %s"
|
||||||
|
|
||||||
- name: insert/update HTML surrounded by custom markers after <body> line
|
- name: insert/update HTML surrounded by custom markers after <body> line
|
||||||
blockinfile:
|
blockinfile:
|
||||||
|
|||||||
Reference in New Issue
Block a user