config-edit - Deprecated, use cme
config-edit [options] ( -application popcon | -model Popcon ) [ ... ] [ commands ... ]
config-edit program will use Config::Model configuration descriptions to validate or modify the configuration file of an application.
config-edit
You can specify commands as arguments that will be run on the configuration root before launching the UI. These command follow the syntax defined in Config::Model::Loader.
config-edit can be run in several modes depending on your needs.
config-edit -application popcon
Provides a user interface so user can easily and securely modify the configuration of their system.
config-edit -ui curses -application popcon
Provides a curses user interface
config-edit -ui shell -application popcon
Provides a shell like interface
config-edit -ui none -application popcon -save
Loads configuration date, perform validation and migration of old data (if specified by the model) and save the new configuration file.
config-edit -ui none -application popcon PARTICIPATE=yes
Loads old configuration data, update PARTICIPATE data, checks the modification and save the configuration back. Option -save is not needed as the data was modified by the command line.
PARTICIPATE
-save
config-edit -model Popcon -gen-pod [ output_dir ]
Generate pod documentation on STDOUT or write them in the specified directory. Note that one pod file will be created per class.
To get man pages or text docuement, you can pipe the output of the command:
config-edit -model Popcon -doc | pod2man > popcon-conf.3
Application name to be configured. Specify help to get a list of available applications.
help
Configuration file name. Used only for models without standard configuration file name. (e.g. multistrap)
Specifies the model used to edit configuration data. Specify help to get a list of available applications. This option is ignored when - application is specified
- application
Specify the user interface type.
tk: provides a Tk graphical interface (If Config::Model::TkUI is installed).
tk
curses: provides a curses user interface (If Config::Model::CursesUI is installed).
curses
shell: provides a shell like interface. See Config::Model::TermUI for details.
shell
fuse: provides an interface through a FUSE virtual file system. You must give a directory where the virtual file system will be mounted with option -fuse_dir. To stop (and write the configuration data back to the configuration file), run fusermount -u <mounted_fuse_dir>. (This is experimental. Mount point specification may change in the future)
fuse
-fuse_dir
fusermount -u <mounted_fuse_dir>
none: No UI provided. Only command line arguments are handled.
none
Use this option if you want to test a model under development. This option will add lib in @INC and use lib/Config/Model/models as model directory. This option is ignored when run as root.
lib
@INC
lib/Config/Model/models
Specify an alternate directory to find model files. Mostly useful for tests.
Specify an instance name. By default the instance name is copied from model name.
Specify a pseudo root directory to read and write the configuration files. (Actual default directory and file names depends on the model (See -model option). For instance, if you specify ~/mytest, the /etc/ssh/sshd_config files will be written in ~/mytest/etc/ssh/ directory.
-model
~/mytest
/etc/ssh/sshd_config
~/mytest/etc/ssh/
Specify the configuration file to edit (which may override the file specified by the model). Note that some applicaitions (like multistrap) will require this option. For other models (like Debian::Dpkg), this option may not make sense as several files are used.
Be (very) verbose
Provide debug infos.
Provides a full stack trace when exiting on error.
Load file even if error are found in data. Bad data are discarded
Apply fixes mentioned in model description. For details, see warn_if_match or warn_unless_match in "" in Config::Model::Value. Configuration files will be saved if invoked with -ui none .
warn_if_match
warn_unless_match
-ui none
Specify a read/write backend. The actual backend name depends on the model passed to -model option. See Config::Model::AutoRead for details.
Dump configuration content on STDOUT or in the specified with Config::Model syntax.
By default, dump only custom values, i.e. different from application built-in values or model default values. See -dumptype option for other types of dump
Choose to dump every values (full), only preset values or only customized values (default)
Load configuration data in model from cds file (using Config::Model serialisation format, typically done with -dump option). When this option is used, the usual configuration files will not be read.
If used with -ui none, this option will load configuration data, validate it and save it in configuration file (if no error was found).
Force re-writing the configuration. (useful for configuration upgrade)
In graphical mode, force the UI to open the node specified. E.g.
-open-item 'foo bar'
Directory where the FUSE virtual file system will be mounted (with -ui fuse)
-ui fuse
You can search the configuration with the following options
Specifies a string or pattern to search. config-edit will a list of path pointing to the matching tree element and their value. See "grab(...)" in Config::Model::AnyThing for details on the path syntax.
Narrows down the search to:
Summary text
description text
value help text
You can use config-edit from another program by using -ui simple option. This way you will be able to send command on the standard input of config-edit and get the results from the standard output.
-ui simple
Configuration data are saved only when :
Requested through the user interface
When commands are specified with arguments
When -load option is used
-load
When -save option is used
You can run safely config-edit -ui none to test a configuration, configuration files will not be modified in this case.
config-edit -ui none
All Config::Model logging is now based on Log::Log4perl. Logging can be configured in the following files:
~/.log4config-model
/etc/log4config-model.conf
Without these files, the following Log4perl config is used:
log4perl.logger=WARN, Screen log4perl.appender.Screen = Log::Log4perl::Appender::Screen log4perl.appender.Screen.stderr = 0 log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Screen.layout.ConversionPattern = %d %m %n
Log4perl uses the following categories:
More categories will come.
For support, please check the following resources:
The config-model users mailing list:
config-model-users at lists.sourceforge.net
The config-model wiki: http://config-model.wiki.sourceforge.net/
Feedback from users are highly desired. If you find this module useful, please share your use cases, success stories with the author or with the config-model- users mailing list.
Dominique Dumont, ddumont at cpan dot org
Config::Model::Model, Config::Model::Instance, Config::Model::Node, Config::Model::HashId, Config::Model::ListId, Config::Model::WarpedNode, Config::Model::Value
To install Config::Model, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Model
CPAN shell
perl -MCPAN -e shell install Config::Model
For more information on module installation, please visit the detailed CPAN module installation guide.