LGTM Enterprise 1.27

lgtm-config-gen.jar

This topic is not relevant if you are running LGTM Enterprise on Kubernetes.

Purpose

Use this Java tool to generate either of the following:

  • A cluster configuration file for a specified host machine.

  • Service configuration files based on a specified cluster configuration file.

You run this Java tool when you want to change the configuration of the LGTM cluster, for example, to add or remove LGTM workers, or change the URL at which LGTM is available. For more details, see Editing and deploying the cluster configuration.

lgtm-config-gen.jar is not available on Windows.

Usage

java -jar <path>/lgtm-config-gen.jar <action> [--verbose] [--verbosity <level>] [--hostname <name>] [--external-url <URL>] [--output <path>] [--input <path>] [--manifest <path>] [--overwrite]

The lgtm-config-gen.jar file is located in the lgtm subdirectory of the release directory—for example, within <path>/lgtm-releases/lgtm-<release-number>/lgtm).

Actions

The action can be:

Flags

Flag Value Notes
--verbose

Optional. Output more detailed information about actions. This increases the verbosity to level 4.

Default (without a --verbose or --verbosity setting): level 3 verbosity

--verbosity Level

Optional. Specify how much detail you want to be included in the output. 0 suppresses all output and 6 outputs all available information. As an alternative, you can use the verbose flag as shorthand for --verbosity 4.

Default (without a --verbosity or --verbose setting): 3

--hostname Host name

For the init action only.

Optional. The host name that will be used for each component in the cluster configuration file that is created.

Default: localhost

--external-url URL

For the init action only.

Optional. The URL at which users will access LGTM Enterprise. This is written to the cluster configuration file.

Default: the value of --hostname

--output Path

If the action is init:

Optional. The path to the cluster configuration file that will be created.

Default: ../../state/lgtm-cluster-config.yml relative to the cluster-config-gen.jar file.

If the action is generate:

The path to a directory in which the configuration files for LGTM services will be generated. The directory will be created if it does not already exist.

Default: ../generated relative to the cluster-config-gen.jar file.

--input Path

For the generate and change-password actions only.

Optional. When the action is generate or change-password, this is the path of the cluster configuration file.

Default: ../../state/lgtm-cluster-config.yml relative to the cluster-config-gen.jar file.

--manifest Path

For the generate and change-password actions only.

Optional. The path to the manifest file.

Default: <path to directory containing cluster configuration file>/manifest.xml

When using the generate or change-password actions, if the manifest file is found at the specified location (or at the default location if this flag is not used) and is password protected, you are prompted to enter the password. With the generate action, if the file is not found you are prompted to supply a password for a new manifest file which is created at the specified (or default) location. The change-password action cannot be completed if the manifest file is not found.

--overwrite

For the generate action only.

Optional. Overwrite the existing output directory if it exists.

If you run lgtm-config-gen.jar from a script or from an Ansible role and you're prompted for the manifest password, you can use the LGTM_CREDENTIALS_PASSWORD environment variable to supply the password directly. For more information about this variable, see LGTM-specific environment variables.

Examples

Creating a basic cluster configuration

To create a simple cluster configuration file for the specified host machine, run this command:

java -jar lgtm/lgtm-config-gen.jar init --hostname "server-one.lgtm-testing.internal"

A basic lgtm-cluster-config.yml configuration file is created in the ../../state directory, relative to the cluster-config-gen.jar file.

Generating files for a cluster configuration

To generate the files required to deploy an LGTM configuration—based on an updated cluster configuration file—run this command:

java -jar lgtm/lgtm-config-gen.jar generate --overwrite

As an --input flag has not been used, this command assumes a ../../state/lgtm-cluster-config.yml file exists, relative to the location of the cluster-config-gen.jar file.

As a --manifest flag has not been used, the command assumes the LGTM credentials store exists at ../../state/manifest.xml, relative to the location of the cluster-config-gen.jar file. If this file is found and is protected by a custom password, you are asked to enter the password. If the file is not found you are asked to enter a password for a new manifest file that will be created in this location.

You can now use the generated files to deploy the revised configuration—see Deploying an updated configuration on Linux hosts or Deploying an updated configuration on Windows hosts.

Setting or changing the manifest password

To set or change the password for accessing credentials in the manifest file, run this command:

java -jar lgtm/lgtm-config-gen.jar change-password

Again, without an --input flag, this command assumes a ../../state/lgtm-cluster-config.yml file exists, relative to the location of the cluster-config-gen.jar file.

If the manifest file is already protected by a password, you are prompted to enter the existing password. You are then asked to enter and confirm a new password.

Related topicsRelated topics