From d2cb676c4c37a098d52e2e1ed2bf95616ea176a0 Mon Sep 17 00:00:00 2001 From: otteydw Date: Wed, 25 Oct 2017 10:11:49 -0400 Subject: [PATCH] Add a validate example to blockinfile. (#32088) --- lib/ansible/modules/files/blockinfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/files/blockinfile.py b/lib/ansible/modules/files/blockinfile.py index fe050b594c..b03f233aca 100644 --- a/lib/ansible/modules/files/blockinfile.py +++ b/lib/ansible/modules/files/blockinfile.py @@ -117,11 +117,12 @@ EXAMPLES = r""" address 192.0.2.23 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: block: "{{ lookup('file', './local/ssh_config') }}" dest: "/etc/ssh/ssh_config" backup: yes + validate: "/usr/sbin/sshd -T -f %s" - name: insert/update HTML surrounded by custom markers after line blockinfile: