LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-13-2008, 03:41 PM   #1
glowe
Member
 
Registered: Jan 2006
Posts: 31

Rep: Reputation: Disabled
Configure sudoers with cfengine


Hi all,

I have a network that uses cfengine with Centos 4 and 5. I'm trying to get the sudoers file updated with cfengine. I know I can kludge a cfengine config for sudoers on a line-by-line basis like this:

AppendIfNoSuchLine "jsmith host1=/etc/rc.d/init.d/coldfusionmx restart"
AppendIfNoSuchLine "jsmith host1=/bin/chown"
AppendIfNoSuchLine "jsmith host2=/etc/rc.d/init.d/coldfusionmx restart"
AppendIfNoSuchLine "jsmith host2=/bin/chown"

The regular sudoers file goes something like this:

Host_Alias COLDFUSIONHOSTS=host1,host2
User_Alias COLDFUSIONFOLKS=jsmith,mjones
COLDFUSIONFOLKS COLDFUSIONHOSTS=/etc/rc.d/init.d/coldfusionmx,/bin/chown

Optimally, I would like to get the cfengine file to have one line to manage multiple hosts and/or users. So, how can I combine the User_Alias, Host_Alias, and their associated commands into the cfengine config without the line-by-line kludge?
 
Old 06-13-2008, 10:39 PM   #2
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
Perhaps I don't understand your intent properly but I would think that you could either:

AppendIfNoSuchLine the host, user, and command alias directives as opposed to the more user specific directives

ie
<code>
AppendIfNoSuchLine "jsmith host1=/etc/rc.d/init.d/coldfusionmx restart"
</code>

You could also provide a single sudoers file to be copied over from the central cfengine server if the sudoers file is static enough.

Third option is to define as cfengine variables things like user list and hostnames and create or append appropriately the lines in cfengine based on said variables.

also I would suggest that this is not really a network question but more of a thread appropriate for the Server or Enterprise forums.

jpbarto
 
Old 06-22-2008, 03:26 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Moved: This thread is more suitable in Linux Software and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Gentlemen, Start your Cfengine jeremy LQ Articles Discussion 0 04-04-2008 01:04 PM
sudoers texerasmo Linux - General 3 08-04-2006 09:57 AM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM
sudoers???? yenonn Slackware 6 02-10-2004 03:09 AM
sudoers........ help linuxlah Linux - General 4 01-14-2003 11:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration