mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
provide usable examples for sudo validation
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user