Way to list all possible overrides in custom-heira.yml?

Is there a way that we can dump out all the possible settings that can be overridden by /etc/foreman-installer/custom-hiera.yml file?

I’d like to be able to grep through the list to find things that can be overridden. It seems like that would be a lot easier than searching and reading the actual installer to code to determine what we can override… If there is a specific search I can direct at the installer code that could generate a list, happy to give it a try.

Thanks,
Mike

AFAIK there’s not an easy one. What makes it difficult is that which parameters are available depends on which classes are included and how they’re included. Compare:

class x ( $param = '' ) { }

include x

class { 'x':
  param => 'value',
}

If there’s no include, you can’t override x::param. With the include you can but with the class you can’t. This means the list of parameters now depends on the installer version (which modules are shipped) and how it’s called (your answers).

There are also things you could override, but it’s not the best way. This can happen when we have a class (say puppet) and an internal class that inherits answers (say puppet::agent). All parameters are exposed on puppet and that should be the place to override them even though you could override them with hiera on puppet::agent.

It might be possible to put hiera in a debug mode to log which parameters were looked up and do an installer run. Perhaps foreman-installer --debug already logs this and you could do some smart grepping in the logs.

thanks for the hint, the log has some statements that helped me find a var I wanted to override with some of the example output below

grep "Automatic Parameter Lookup of" foreman-installer.log
...
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_environment_timeout'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_jvm_java_bin'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_jvm_config'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_jvm_min_heap_size'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_jvm_max_heap_size'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_jvm_extra_args'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_jruby_gem_home'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_max_active_instances'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_max_requests_per_instance'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_use_legacy_auth_conf'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_check_for_updates'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_environment_class_cache_enabled'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'puppet::server_allow_header_cert_info'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'foreman::cli::foreman_url'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'foreman::cli::version'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'foreman::cli::manage_root_config'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'foreman::cli::username'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'foreman::cli::password'
[DEBUG 2018-06-06 10:04:56 main]  Automatic Parameter Lookup of 'foreman::cli::refresh_cache'
...

puppet-string might help, though I don’t think it can do exactly what you want out the box today.