Support Questions
Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

Using include statement in Cloudera Director HOCON config to import customer properties

Expert Contributor



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: ""
dbUser: postgres





Further down in the file, we reference these configs like so:


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(""))


include file("")


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?


Cloudera Employee


include "someother.conf"

View solution in original post


Cloudera Employee


include "someother.conf"

Expert Contributor

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? 




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: