NAME
config-edit - Edit data of configuration managed by Config::Model
SYNOPSIS
config-edit [options] ( -application popcon | -model Popcon ) [ ... ] [ commands ... ]
DESCRIPTION
config-edit
program will use Config::Model configuration descriptions to validate or modify the configuration file of an application.
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.
Graphical interface
config-edit -application popcon
Provides a user interface so user can easily and securely modify the configuration of their system.
Curses interface
config-edit -ui curses -application popcon
Provides a curses user interface
Shell like interface
config-edit -ui shell -application popcon
Provides a shell like interface
upgrade mode
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.
Direct modification of configuration data
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.
Generation of configuration documentation
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
Options
- application
-
Application name to be configured. Specify
help
to get a list of available applications. - -model
-
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 - -ui
-
Specify the user interface type.
tk
: provides a Tk graphical interface (If Config::Model::TkUI is installed).curses
: provides a curses user interface (If Config::Model::CursesUI is installed).shell
: provides a shell like interface. See Config::Model::TermUI for details.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), runfusermount -u <mounted_fuse_dir>
. (This is experimental. Mount point specification may change in the future)none
: No UI provided. Only command line arguments are handled.
- -dev
-
Use this option if you want to test a model under development. This option will add
lib
in@INC
and uselib/Config/Model/models
as model directory. This option is ignored when run as root. - -model_dir
-
Specify an alternate directory to find model files. Mostly useful for tests.
- -instance_name
-
Specify an instance_name. By default the instance name is copied from model name.
- -root_dir
-
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. - -verbose
-
Be (very) verbose
- -debug
-
Provide debug infos.
- -trace
-
Provides a full stack trace when exiting on error.
- -force-load
-
Load file even if error are found in data. Bad data are discarded
- -apply-fixes
-
Apply fixes mentioned in model description. For details, see
warn_if_match
orwarn_unless_match
in "" in Config::Model::Value. Configuration files will be saved if invoked with-ui none
. - -backend
-
Specify a read/write backend. The actual backend name depends on the model passed to
-model
option. See Config::Model::AutoRead for details. - -dump [ file ]
-
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
- -dumptype [ full | preset | custom ]
-
Choose to dump every values (full), only preset values or only customized values (default)
- -load <cds_file_to_load>
-
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). - -save
-
Force re-writing the configuration. (useful for configuration upgrade)
- -open_item 'path'
-
In graphical mode, force the UI to open the node specified. E.g.
-open_item 'foo bar'
- -fuse_dir
-
Directory where the FUSE virtual file system will be mounted (with
-ui fuse
)
Embedding config-edit
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.
Saving configuration data
Configuration data are saved only when :
Requested through the user interface
When commands are specified with arguments
When
-load
option is usedWhen
-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.
LOGGING
All Config::Model logging is (slowly) moved from klunky debug and verbose prints to 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:
- Model
- Model::Load
- Data
-
Used by read and write handler (Config::Model::AutoRead)
- Model::Searcher
- Instance
- Tree::Element::Value
- Tree::Element::Id
- Tree::Element::Id::Hash
- Tree::Element::Id::List
- Tree::Element::Warper
- Tree::Element::Warped
- Tree::Element::CheckList
- Tree::Node
- Loader
- Backend::Yaml
- Wizard::Helper
- Anything
- ValueComputer
More categories will come.
SUPPORT
For support, please check the following ressources:
The config-model users mailing list:
config-model-users at lists.sourceforge.net
The config-model wiki: http://config-model.wiki.sourceforge.net/
FEEDBACKS
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.
AUTHOR
Dominique Dumont, ddumont at cpan dot org
SEE ALSO
Config::Model::Model, Config::Model::Instance, Config::Model::Node, Config::Model::HashId, Config::Model::ListId, Config::Model::WarpedNode, Config::Model::Value