diff --git a/lib/ansible/modules/files/copy.py b/lib/ansible/modules/files/copy.py index c2b652dda8a..48b75be2fbf 100644 --- a/lib/ansible/modules/files/copy.py +++ b/lib/ansible/modules/files/copy.py @@ -143,14 +143,14 @@ EXAMPLES = r''' - copy: src: /mine/sudoers dest: /etc/sudoers - validate: visudo -cf %s + validate: /usr/sbin/visudo -cf %s # Copy a "sudoers" file on the remote machine for editing - copy: src: /etc/sudoers dest: /etc/sudoers.edit remote_src: yes - validate: visudo -cf %s + validate: /usr/sbin/visudo -cf %s # Create a CSV file from your complete inventory using an inline template - hosts: all diff --git a/lib/ansible/modules/files/lineinfile.py b/lib/ansible/modules/files/lineinfile.py index 4a2444c3783..d26dcac5725 100644 --- a/lib/ansible/modules/files/lineinfile.py +++ b/lib/ansible/modules/files/lineinfile.py @@ -184,7 +184,7 @@ EXAMPLES = r""" state: present regexp: '^%ADMIN ALL=' line: '%ADMIN ALL=(ALL) NOPASSWD: ALL' - validate: 'visudo -cf %s' + validate: '/usr/sbin/visudo -cf %s' """ import re diff --git a/lib/ansible/modules/files/template.py b/lib/ansible/modules/files/template.py index b159beb01b0..f211378c3be 100644 --- a/lib/ansible/modules/files/template.py +++ b/lib/ansible/modules/files/template.py @@ -137,7 +137,7 @@ EXAMPLES = r''' - template: src: /mine/sudoers dest: /etc/sudoers - validate: 'visudo -cf %s' + validate: '/usr/sbin/visudo -cf %s' # Update sshd configuration safely, avoid locking yourself out - template: