NAME
shell_var_reader - Read/run a shell script and return set variable in it.
SYNOPSIS
shell_var_reader -r <file> [-o <format>] [-p] [-s] [--tcmdb <dir>] [--cmdb_host <host>] [--host_vars <vars>] [--use_roles [01]]
FLAGS
-r <file>
The file to read/run.
-o <format>
The output format.
Default: json
Formats: json,yaml,toml,dumper(Data::Dumper),shell
-p
Pretty print. Not relevant to all outputs.
-s
Sort. Not relevant to all outputs.
-i <include>
Files to parse and include in the produced JSON, TOML, or YAML.
The included file may be either JSON, TOML, or YAML.
If a comma is included, everything before the comma is used as the key name to include the parsed data as. Otherwise it will me merged.
Include Examples...
Read in bar.json and include it as the variable foo.
-i foo,bar.json
Read in foo.toml and merge it with what it is being merged into taking presidence.
-i foo.toml
Read in a.json and merge it, then read in in b.json and merge it.
-i a.jsom -i b.toml
CMDB FLAGS
Includes data from a CMDB and merge it in. Will overwrite everything previous.
--tcmdb <dir>
Optionally include data from a Rex TOML CMDB. See Rex::CMDB::YAML for more information on that.
--cmdb_host <host>
Hostname to use when querying the CMDB.
Default :: undef
--host_vars <vars>
If --cmdb_host is undef, check this comma seperated list JSON Paths in the currently found/included vars for the first possible hit. For more info the path stuff, see JSON::Path.
Default :: HOSTNAME,REX_NAME,REX_HOSTNAME,ANSIBLE_HOSTNAME,ANSIBLE_NAME,NAME
--use_roles [01]
If roles should be used or not with the Rex TOML CMDB.
Default :: 1