From 5acbb42dc42dba0573a0a0ceed3f6e419837de22 Mon Sep 17 00:00:00 2001 From: Arnaud Venturi Date: Tue, 20 Aug 2019 14:54:02 +0000 Subject: [PATCH] Fix ssh example with sshd config (#60821) The example tries to validate a sshd config, but provides sshd (server) a client configuration. If trying to execute the given validation command on a client file, it doesn't work (e.g. running `/usr/sbin/sshd -T -f /etc/ssh/sshd_config` returns non-zero code) --- lib/ansible/modules/files/blockinfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/files/blockinfile.py b/lib/ansible/modules/files/blockinfile.py index b4cc36c9e2b..163eaee56b0 100644 --- a/lib/ansible/modules/files/blockinfile.py +++ b/lib/ansible/modules/files/blockinfile.py @@ -119,8 +119,8 @@ EXAMPLES = r''' - name: Insert/Update configuration using a local file and validate it blockinfile: - block: "{{ lookup('file', './local/ssh_config') }}" - dest: /etc/ssh/ssh_config + block: "{{ lookup('file', './local/sshd_config') }}" + dest: /etc/ssh/sshd_config backup: yes validate: /usr/sbin/sshd -T -f %s