Created on 10-20-2017 12:45 PM - edited 09-16-2022 08:25 AM
Hello.
We are using Cloudera Director 2.6.0 to deploy our clusters.
Currently, we define customer specific parameters at the top of the customer config file like so:
customer-params {
name: "customerX"
environmentName: "customerX Environment"
subnetId: "subnet-cjkkd00se"
securityGroupsIds: "sg-1se36d6c,sg-c8f372ba"
dbHost: "customerX-postgres.cesosptkafdpf.us-east-1.rds.amazonaws.com"
dbUser: postgres
...
...
}
Further down in the file, we reference these configs like so:
name: ${customer-params.name}
environmentName: ${customer-params.environmentName}
This works like a charm, but we would prefer to manage customer specific settings separate from the client config file.
According to HOCON spec, we should be able to include these customer specifc settings like so:
include required(file("customer.properties"))
or
include file("customer.properties")
Has anyone confirmed that this works? Using required throws the following error in the director client application.log:
[2017-10-20 14:46:04.600 -0400] ERROR [main] - com.cloudera.launchpad.Application: Failed to initialize application context
com.typesafe.config.ConfigException$Parse: customer-config/c32/c32.conf: 1: expecting include parameter to be quoted filename, file(), classpath(), or url(). No spaces are allowed before the open paren. Not expecting: 'required(file('
Removing the "required" directive gets rid of this error, but then we run into errors trying to resolve the substitutions - which leads me to think our properties file isn't getting included.
Are there any examples of this that I can reference. Anyone else had luck doing this?
Created 10-20-2017 02:52 PM
Created 10-20-2017 02:52 PM
try
include "someother.conf"
Created 10-24-2017 08:16 AM
Thanks lyin. That did the trick. Any reason why the spec syntax did not work? Is there another HOCON spec out there that I should be referencing?
Created 10-26-2017 09:57 AM
include file(...) should work but I believe it requires the full file path.
The current latest version of Director (Director 2.6) is on typesafe config version 1.2 which doens't have support for required. You can refer to the following spec to see what's supported in this verison: https://github.com/lightbend/config/blob/v1.2.0/HOCON.md