The controller and scheduler both take a `metadata` command-line argument to output OCF-like metadata for the cluster options that they use. This has a few problems: both have to be run to see all options, options that they both use are in both sets of metadata, and a couple options aren't listed in either because they are used only by the CIB manager, which doesn't have a metadata argument (see `cib_opts`).
`etc/sysconfig/pacemaker` documents most but not all of the environment variables, and isn't available in a convenient OCF-like form from the command-line.
Pacemaker accepts meta-attributes for alert, primitive, group, clone, bundle, operation, rsc_defaults, and op_defaults. //Pacemaker Explained// documents most but not all of them, and again isn't available in a parseable form.
`crm_attribute` would be a reasonable place to put new command-line options for this, maybe `--list-options`, `--list-environment`, and `--list-meta [context]`, or maybe a single `--list-options [type]` argument. They should support both text and XML output, with the XML being OCF-like.
As part of this, we will likely need some sort of internal API for these that the rest of the code must use to access options (rather than directly access them via `getenv()` etc.), so that we can guarantee we have one comprehensive list. This could replace or evolve from `pcmk__cluster_option_t`. It might even be worthwhile to keep the OCF-like metadata in XML files to be used as the definitive list, with the sysconfig file, ReST files for the books, and C and Python data files created from it automatically via make targets. Alternatively, we could install the XML files, and C and Python APIs could parse them.
Feel free to separate out subtasks for this
* [[https://bugzilla.redhat.com/show_bug.cgi?id=2163699 | RHBZ#2163699]]
* [[https://bugzilla.redhat.com/show_bug.cgi?id=2182383 | RHBZ#2182383]]