Blob Blame History Raw
From f85b3ba942c0347c197cd738fab444fe9a697a62 Mon Sep 17 00:00:00 2001
From: Martin Kosek <mkosek@redhat.com>
Date: Wed, 15 Jan 2014 09:31:37 +0100
Subject: [PATCH 21/25] Add missing example to sudorule

https://fedorahosted.org/freeipa/ticket/4090
---
 ipalib/plugins/sudorule.py | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/ipalib/plugins/sudorule.py b/ipalib/plugins/sudorule.py
index a89941cb6ab9b258de26bb7cf3632dc0acc7e20e..9644aafa263b4790c8123d177f0ccd10b572f0f0 100644
--- a/ipalib/plugins/sudorule.py
+++ b/ipalib/plugins/sudorule.py
@@ -52,7 +52,26 @@
 -h ipa.example.com -ZZ -D "cn=Directory Manager" \
 uid=sudo,cn=sysaccounts,cn=etc,dc=example,dc=com
 
-For more information, see the FreeIPA Documentation to Sudo.
+EXAMPLES:
+
+ Create a new rule:
+   ipa sudorule-add readfiles
+
+ Add sudo command object and add it as allowed command in the rule:
+   ipa sudocmd-add /usr/bin/less
+   ipa sudorule-add-allow-command readfiles --sudocmds /usr/bin/less
+
+ Add a host to the rule:
+   ipa sudorule-add-host readfiles --hosts server.example.com
+
+ Add a user to the rule:
+   ipa sudorule-add-user readfiles --users jsmith
+
+ Add a special Sudo rule for default Sudo server configuration:
+   ipa sudorule-add defaults
+
+ Set a default Sudo option:
+   ipa sudorule-add-option defaults --sudooption '!authenticate'
 """)
 
 topic = ('sudo', _('Commands for controlling sudo configuration'))
-- 
1.8.4.2