Puppet-elastic module and elasticsearch.yml



In the puppet templates, what we defined is as follow.
group_search => {
base_dn => 'OU=X,OU=Y,OU=Enterprise Services,DC=A,DC=B,DC=C',
scope => 'one_level',

The following is what we get in the generated elasticsearch.yml
xpack.security.authc.realms.active_directory.group_search.base_dn: OU=X,OU=Y,OU=Enterprise

the space inside "Enterprise Services" in the puppet templates is converted into 'new line (\n)' in the corresponding item inside elasticsearch.yml.

Could someone shed light on it?

Thanks in advance!


(Tyler Langlois) #2

Hi @xzhou,

The Puppet module just uses Ruby's built-in hash-to-yaml library to create the Yaml configuration file. If you'd like to enforce that the value be kept in a more strict string, I'd suggest trying to wrap the value in additional quotes, for example:

'"OU=X,OU=Y,OU=Enterprise Services,DC=A,DC=B,DC=C"'


Hi Tyler,

Unfortunately it does not work. puppet creates the following.

xpack.security.authc.realms.active_directory.group_search.base_dn: '"OU=X,OU=Y,OU=Enterprise

Thanks, xzhou

(Tyler Langlois) #4

Hi @xzhou, could you share:

  • What version of Puppet you're running
  • What OS/Distro you're using

In some simple testing in ruby, to_yaml doesn't appear to split lines at spaces, so I'm trying to track down what may be different in your environment.

(system) closed #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.