Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 06-13-2008, 04:41 PM   #1
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, 11:39 PM   #2
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

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

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.

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

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:04 PM
sudoers texerasmo Linux - General 3 08-04-2006 10: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 06:03 PM
sudoers???? yenonn Slackware 6 02-10-2004 04:09 AM
sudoers........ help linuxlah Linux - General 4 01-15-2003 12:54 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:03 PM.

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