Re: [webmin-devel] Newbie Question - Default Configuration

"Jamie Cameron" <[email protected]> Mon, 25 May 2009 14:48:46 -0700 (PDT)
Newsgroups gmane.comp.web.webmin.devel
Message-ID <[email protected]>
On 25/May/2009 11:56 skin derneath <[email protected]> wrote ..
> I would first like to thank the developers for creating such a beautiful
> application. It has sped up all our work.
> This may be an embarrassing question to ask, but I've not been able to find
> an answer anywhere else. I would like to install Webmin on multiple systems
> and I would like to adjust the default configuration of certain modules so
> that I don't need to go and manually update the configuration files in each
> of the systems I want to manage with Webmin.
> 
> Take for example, the Postfix module.
> 
> I have several options that I can change on the general.cgi page. Those
> options when changed append the corresponding statements to /etc/postfix/
> main.cf
> 
> The first option allows me to change the value of the variable $myorigin. I
> would like to know how I should make changes to the Postfix module so that
> the change I've made now becomes the default for all my other installs. That
> is, when I pick up the webmin folder and install it on another computer by
> executing setup.sh, I want these settings to be applied automatically.
> 
> In simple words, how should I change the default configuration of a module?

You can't actually do this with Webmin, as the default configuration of Postfix
is determined by the Postfix package, not by Webmin. The alternative is to
write your own script that you run on the new system after installation that
configures Postfix or whatever to the setup you are looking for. 

You could use a script like :

#!/usr/bin/perl

use Webmin::API;
foreign_require("postfix", "postfix-lib.pl");
print postfix::get_current_value("mydestination"),"\n";
postfix::set_current_value("myorigin", "whatever.com");

This makes use of the Webmin::API perl module, which is a simple
wrapper that makes it easy to call Webmin API functions from your
own scripts. To get it, see :
http://www.webmin.com/modules-commandline.html

 - Jamie


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
-
Forwarded by the Webmin development list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel