Configuration¶
For configuration, opentf-ctl
looks for a file named config
in the $HOME/.opentf
directory. You can specify another configuration file by setting the OPENTF_CONFIG
environment variable or by using the --opentfconfig
command-line option.
If the command-line option is specified, then it is used as the configuration file.
Otherwise, if the environment variable is set, it is used as the configuration file
location. Otherwise, the configuration file location is expected to be
$HOME/.opentf/config
.
The configuration file is a YAML file with the following structure:
apiVersion: opentestfactory.org/v1beta1
kind: CtlConfig
current-context: default
contexts:
- context:
orchestrator: default
user: default
name: default
orchestrators:
- name: default
orchestrator:
insecure-skip-tls-verify: true
server: http://localhost
services:
receptionist:
port: 7774
observer:
port: 7775
killswitch:
port: 7776
eventbus:
port: 38368
localstore:
port: 34537
agentchannel:
port: 24368
qualitygate:
port: 12312
users:
- name: default
user:
token: ey...
step-depth: ...
job-depth: ...
max-command-length: ...
It contains a series of contexts that specify an orchestrator and a user. By default,
the used context will be the one specified by current-context
, but this can be overridden
by using the --context
command-line option.
The orchestrator specified by the selected context can be overridden by using the
--orchestrator
command-line option.
The user specified by the selected context can be overridden by using the --user
command-line option.
The orchestrator’s tls-verify status can be overridden by using the --insecure-skip-tls-verify
command-line option.
The user’s token can be overridden by defining the OPENTF_TOKEN
environment variable
or the --token
command-line option.
If the command-line option is specified, then it is used as the token. Otherwise, if the environment variable is set, it is used as the token. Otherwise, the token value set for the user in the configuration file is used as the token.
If the orchestrator endpoints all listen on the same server, port, and possibly path prefix,
the orchestrator’s services
section can be omitted.
If one endpoint is hosted on another server or uses a customized route or port, it can be specified as such:
...
orchestrator:
server: http://localhost
services:
observer:
prefix: foobar
port: 1234
That way, instead of performing a workflows’ lookup using http://localhost/workflows
,
opentf-ctl
will use http://localhost:1234/foobar/workflows
instead, while still
using http://localhost/workflows
to run workflows.
Please refer to “config set-orchestrator” for more information.
Tip
opentf-ctl
respects the common proxy and trusted certificates environment variables.
Please refer to “Proxy and Trusted certificates” for
more information.