NAME
Shell::Var::Reader::CMDB - Helper for creating and updating shell_var_reader based CMDB.
VERSION
Version 0.1.2
SUBROUTINES
init
Initiates a directory tree for creating a CMDB using shell_var_reader. with some very minor example stuff.
Shell::Var::Reader::CMDB->init(
dir=>'./foo/',
exists_okay=>1,
verbose=>1,
init_group_slug=>'example',
);
At the minimum 'dir' must be specified.
- dir :: Path to where to create it.
- Default :: undef.
- exists_okay :: If the directory already existing is okay.
- Default :: 1
- verbose :: If it should be verbose or not.
- Default :: 1
- init_group_slug :: Name of the example group dir.
- Default :: example
update
Reads through the directory and process all relevant files.
Shell::Var::Reader::CMDB->update(
dir=>'./foo/',
verbose=>1,
);
At the minimum 'dir' must be specified.
- dir :: Path to where to create it.
- Default :: undef.
- verbose :: If it should be verbose or not.
- Default :: 1
LAYOUT & WORKFLOW
Specifically named files.
- .shell_var_reader :: Marks the base directory as being for a shell_var_reader CMDB.
Specifically named directories.
- cmdb :: The TOML CMDB directory.
- json_confs :: Generated JSON confs.
- shell_confs :: Generated shell confs.
- toml_confs :: Generated TOML confs.
- yaml_confs :: Generated YAML confs.
Other directories that that don't start with a '.' or contiain a file named '.not_a_system_group' will be processed as system groups.
These directories will be searched for files directly below them for files ending in '.sh' and not starting with either a '_' or a '.'. The name used for a system is the name of the file minus the ending '.sh', so 'foo.bar.sh' would generate a config for a system named 'foo.bar'.
When it finds a file to use as a system config, it will point shell_var_reader at it with TOML CMDB enabled and with the name of that system set the hostname to use with the TOML CMDB. That name will also be saved as the variable 'SYSTEM_NAME', provided that variable is not defined already. If a 'munger.pl' exists, that file is used as the munger file. shell_var_reader will be ran four times, once to generate each config type.
AUTHOR
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
BUGS
Please report any bugs or feature requests to bug-shell-var-reader at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Shell-Var-Reader. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Shell::Var::Reader
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
This software is Copyright (c) 2023 by Zane C. Bowers-Hadley.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)