Centralized place for reading a user-defined config INI file, validating, defaulting and converting into a format that can startup a PuppetDB instance.
The schemas in this file define what is expected to be present in the INI file and the format expected by the rest of the application.
Centralized place for reading a user-defined config INI file, validating, defaulting and converting into a format that can startup a PuppetDB instance. The schemas in this file define what is expected to be present in the INI file and the format expected by the rest of the application.
(all-optional map-schema)Returns a schema map with all the keys made optional
Returns a schema map with all the keys made optional
Schema for incoming command processing config (user defined) - currently incomplete
Schema for incoming command processing config (user defined) - currently incomplete
Schema for parsed/processed command processing config - currently incomplete
Schema for parsed/processed command processing config - currently incomplete
(configure-globals config)Configures the global properties from the user defined config
Configures the global properties from the user defined config
(configure-puppetdb config)Validates the [puppetdb] section of the config
Validates the [puppetdb] section of the config
(configure-read-db {:keys [database read-database] :as config})Ensures that the config contains a suitable [read-database]. If the section already exists, validates and converts it to the internal format. Otherwise, creates it from values in the [database] section, which must have already been fully configured.
Ensures that the config contains a suitable [read-database]. If the section already exists, validates and converts it to the internal format. Otherwise, creates it from values in the [database] section, which must have already been fully configured.
(configure-section config section schema-in schema-out)Validates the indicated top-level section of an incoming config and establishes defaults as specified by schema-in, and then coerces the values and validates the final result as specified by schema-out.
Validates the indicated top-level section of an incoming config and establishes defaults as specified by schema-in, and then coerces the values and validates the final result as specified by schema-out.
(convert-blocklist-config config)Validate and convert facts blocklist section of the config to runtime format. Throws a {:type ::cli-error :message m} exception describing errors when compiling facts-blocklist regex patterns if :facts-blocklist-type is set to "regex".
Validate and convert facts blocklist section of the config to runtime format.
Throws a {:type ::cli-error :message m} exception describing errors when compiling
facts-blocklist regex patterns if :facts-blocklist-type is set to "regex".(convert-certificate-whitelist-to-allowlist pdb-section)(convert-config config)Given a config map (created from the user defined config), validate, default and convert it
to the internal Clojure format that PuppetDB expects
Given a `config` map (created from the user defined config), validate, default and convert it to the internal Clojure format that PuppetDB expects
(default-max-command-size)Returns the max command size relative to the current max heap. This number was reached through testing of large catalogs and 1/205 was the largest catalog that could be processed without GC or out of memory errors
Returns the max command size relative to the current max heap. This number was reached through testing of large catalogs and 1/205 was the largest catalog that could be processed without GC or out of memory errors
Half the number of CPU cores, used for defaulting the number of command processors
Half the number of CPU cores, used for defaulting the number of command processors
(half-the-cores*)Function for computing half the cores of the system, useful for testing.
Function for computing half the cores of the system, useful for testing.
(hook-tk-parse-config-data f args)This is a robert.hooke compatible hook that is designed to intercept trapperkeeper configuration before it is used, so that we may munge & customize it. It may throw {:type ::cli-error :message m}.
This is a robert.hooke compatible hook that is designed to intercept
trapperkeeper configuration before it is used, so that we may munge &
customize it. It may throw {:type ::cli-error :message m}.(mq-thread-count config)Returns the desired number of MQ listener threads.
Returns the desired number of MQ listener threads.
(normalize-product-name product-name)Checks that product-name is specified as a legal value, throwing an
exception if not. Returns product-name if it's okay.
Checks that `product-name` is specified as a legal value, throwing an exception if not. Returns `product-name` if it's okay.
Schema for incoming database config (user defined)
Schema for incoming database config (user defined)
Schema for parsed/processed database config
Schema for parsed/processed database config
Includes the common database config params, also the write-db specific ones
Includes the common database config params, also the write-db specific ones
Schema for parsed/processed database config that includes write database params
Schema for parsed/processed database config that includes write database params
(prefer-db-user-on-username-mismatch {:keys [user username] :as config}
db-section-name)(process-config! config)Accepts a map containing all of the user-provided configuration values and configures the various PuppetDB subsystems.
Accepts a map containing all of the user-provided configuration values and configures the various PuppetDB subsystems.
Schema for validating the incoming [puppetdb] block
Schema for validating the incoming [puppetdb] block
Schema for validating the parsed/processed [puppetdb] block
Schema for validating the parsed/processed [puppetdb] block
(redirect-obsolete-config-setting config obsolete replacement)(require-db-subname {:keys [subname] :as config} section-key)Ensures the database config includes a subname. Throws a {:type ::cli-error :message m} on error.
Ensures the database config includes a subname. Throws a
{:type ::cli-error :message m} on error.(require-enclosing-report-ttl {:keys [resource-events-ttl report-ttl]
:as config}
section-key)Ensures the report-ttl is at least as long as the resource-events-ttl. Throws a {:type ::cli-error :message m} on error.
Ensures the report-ttl is at least as long as the
resource-events-ttl. Throws a {:type ::cli-error :message m} on error.(validate-and-default-incoming-config config schema-in)(validate-vardir config)Checks that vardir is specified, exists, and is writeable, throwing
appropriate exceptions if any condition is unmet.
Checks that `vardir` is specified, exists, and is writeable, throwing appropriate exceptions if any condition is unmet.
(warn-and-validate schema data)Warns a user about unknown configurations items, removes them and validates the config.
Warns a user about unknown configurations items, removes them and validates the config.
(warn-if-mismatched-node-purge-ttls config)Warn if the read-database has a node-purge-ttl that doesn't match the value for a database with the same subname.
Warn if the read-database has a node-purge-ttl that doesn't match the value for a database with the same subname.
(warn-retirements config-data)Warns about configuration retirements. Abruptly exits the entire process if a [global] url-prefix is found.
Warns about configuration retirements. Abruptly exits the entire process if a [global] url-prefix is found.
(write-databases config)Inputs: [config]
Returns a map of database names to their configs. Each :database-NAME section in the config will produce a map entry with NAME as the key. If the config only contains a single :database section, its key will be "default" and its config map will have ::unnamed set to true.
Inputs: [config] Returns a map of database names to their configs. Each :database-NAME section in the config will produce a map entry with NAME as the key. If the config only contains a single :database section, its key will be "default" and its config map will have ::unnamed set to true.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |