libre-server / rolekit

'rolekit' is a daemon for Linux systems providing a stable D-BUS interface to manage the deployment of ​Server Roles.
19 stars 7 forks source link

'rolectl settings <role>' should list mandatory and optional settings for deployment #19

Open sgallagher opened 8 years ago

sgallagher commented 8 years ago

The current implementation is just listing off the defaults set in the environment. This is a complete list of understood options, but it doesn't provide the user with any guidance what they need to set in a --settings-file. For domaincontroller right now:

[root@rolekit-test ~]# rolectl settings domaincontroller
custom_firewall = False
primary_ip = None
reverse_zone = None
firewall = {'services': ['freeipa-ldap', 'freeipa-ldaps', 'dns'], 'ports': []}
domain_name = None
realm_name = None
root_ca_file = None
setup_dns = True
version = 1
firewall_zones = []
services = ['freeipa']
packages = ['@freeipa-server']
dm_password = None
id_max = 199999

It would be ideal if this was actually provided as a JSON output. We should have two options, mandatory and optional showing the minimum subset of necessary input options and the complete set, respectively. (I'd prefer to have these as comments in a single JSON input, but because JSON parsers don't handle comments, we'd have to pipe it through a minifier first...) Example:

[root@rolekit-test ~]# rolectl settings domaincontroller
{
    "primary_ip" = null,
    "dm_password" = null,
    "domain_name" = null
}

[root@rolekit-test ~]# rolectl settings --all domaincontroller
{
    "primary_ip" = null,
    "dm_password" = null,
    "domain_name" = null,
    "min_id" = "9999",
    "root_ca_file" = null
    <...>
}