-
Notifications
You must be signed in to change notification settings - Fork 2
config
Neil Fritz edited this page May 30, 2016
·
6 revisions
Hecate config is sourced from three locations and is overlaid as each locations is processed:
/usr/local/hecate/etc/config.json
~/.hecate/config.json
- Command line arguments
-consul-host CONSUL_HOST, -ch CONSUL_HOST
--consul-port CONSUL_PORT, -cp CONSUL_PORT
--consul-token CONSUL_TOKEN, -ct CONSUL_TOKEN
--consul-data-center CONSUL_DATA_CENTER, -cd CONSUL_DATA_CENTER
--consul-verify-ssl, -cv
On-disk config is stored in JSON format as follows:
{
"consul_host": "10.20.115.20",
"consul_port": 8600,
"consul_token": "7022ab08-734e-4324-9b9a-324cb0ebbfa9",
"consul_dc": "dc1",
"consul_verify_ssl": true
}
All configuration is optional, however, Hecate requires a consul_host
and a consul_port
to operate properly. By default these values are not set.
usage: hecate config [-h] [--global] [--edit]
optional arguments:
-h, --help show this help message and exit
--global, -g Global configuration
--edit, -e Edit configuration
-
--edit
- creates or overwrites the existing configuration and stores it to disk -
--global
- when specified with--edit
, this will modify the global configuration -/usr/local/hecate/etc/config.json
. When not specified, the local user config will be edited -~/.hecate/config.json
Pinky:bin ncfritz$ ./hecate config
Scope | consul_host | consul_port | consul_token | consul_dc | consul_verify_ssl
---------+--------------------------------+-------------+------------------------------------------+--------------------------------+------------------
Default | 127.0.0.1 | 8500 | | |
Global | 10.0.0.115 | 8600 | 23f20b4b-ca08-4f2a-8edc-f6e6aff544d4 | dc1 | True
User | 10.10.15.23 | 8675 | 88c94d8f-885b-40ec-ad50-b839d64f48ac | local | False
Args | | | | | False
---------+--------------------------------+-------------+------------------------------------------+--------------------------------+------------------
Merged | 10.10.15.23 | 8675 | 88c94d8f-885b-40ec-ad50-b839d64f48ac | local | False
If the user wanted to override the consul_token
and consul_verify_ssl
they could specify --consul-data-center
and --consul-verify-ssl
. NOTE: The command list arguments must be specified every time you run Hecate if you wish to override stored values.
Pinky:bin ncfritz$ ./hecate --consul-data-center test --consul-verify-ssl config
Scope | consul_host | consul_port | consul_token | consul_dc | consul_verify_ssl
---------+--------------------------------+-------------+------------------------------------------+--------------------------------+------------------
Default | 127.0.0.1 | 8500 | | |
Global | 10.0.0.115 | 8600 | 23f20b4b-ca08-4f2a-8edc-f6e6aff544d4 | dc1 | True
User | 10.10.15.23 | 8675 | 88c94d8f-885b-40ec-ad50-b839d64f48ac | local | False
Args | | | | test | True
---------+--------------------------------+-------------+------------------------------------------+--------------------------------+------------------
Merged | 10.10.15.23 | 8675 | 88c94d8f-885b-40ec-ad50-b839d64f48ac | test | True
Pinky:bin ncfritz$ sudo ./hecate config --edit --globl
Password:
Consul host [IP]: 10.0.0.115
Consul port: 8600
Token: 23f20b4b-ca08-4f2a-8edc-f6e6aff544d4
Data Center: dc1
Verify SSL [y/N]: y