Age | Commit message (Collapse) | Author |
|
thanks to @richih
|
|
|
|
|
|
Variables can now be fed to model from multiple locations. In order of
preference:
1) node (from source)
2) group
3) global
In a model vars should be accessed via 'vars' helper method though it is
not required. Helper method ignores nil values so care needs to taken
when designing model behaviour.
Support for node level vars is currently available on sql source via
'vars_map' configuration.
Following example populates node vars 'enable' and 'somevariable' from sql
columns 'var_enable' and 'var_somevariable'
sql:
adapter: sqlite
file: /home/aakso/.config/oxidized/sqrouter.db
table: nodes
map:
name: hostname
model: model
group: node_group
username: username
password: password
vars_map:
enable: var_enablepw
somevariable: var_somevariable
|
|
Model can inmplement something like
cmd :secret do |cfg|
cfg.sub! / secret (\d+) (\S+).*/, '\\1 SECRET'
cfg
end
Which is called for all commands if CFG.remove_secret is set
|
|
It is now separately in oxidized-web package
|
|
Once web is moved to 'oxidized-web' package and sqlite+git dependencies
are removed, it's lot easier to install 'oxidized-script' + 'oxidized'
on other machines which actually don't intend to run oxidized to collect
config
Now as we depend on puma + sqlite we need to compile native extensions,
which may be problematic and certainly unnecesassary just to run 'oxs'
|
|
Main benefits
a) we get support for system wide configs
b) we don't use symbols in config file, they're confusing to
non-rubyist
|