# Puppet-elastic module and elasticsearch.yml

**URL:** <https://discuss.elastic.co/t/puppet-elastic-module-and-elasticsearch-yml/157941>\
**Category:** Elasticsearch\
**Created:** [November 22, 2018, 8:51pm UTC](https://discuss.elastic.co/t/puppet-elastic-module-and-elasticsearch-yml/157941 "2018-11-22T20:51:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xzhou](https://avatars.discourse-cdn.com/v4/letter/x/3be4f8/32.png) [@xzhou](https://discuss.elastic.co/u/xzhou)\
**Post date:** [November 22, 2018, 8:51pm UTC](https://discuss.elastic.co/t/puppet-elastic-module-and-elasticsearch-yml/157941/1 "2018-11-22T20:51:30Z")

</div>

Hi

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  
Services,DC=A,DC=B,DC=C  
....

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!

xzhou

---

<div class="post-metadata">

**Author:** ![tylerjl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylerjl/32/44965_2.png) [@tylerjl](https://discuss.elastic.co/u/tylerjl)\
**Post date:** [November 27, 2018, 12:14am UTC](https://discuss.elastic.co/t/puppet-elastic-module-and-elasticsearch-yml/157941/2 "2018-11-27T00:14:33Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![xzhou](https://avatars.discourse-cdn.com/v4/letter/x/3be4f8/32.png) [@xzhou](https://discuss.elastic.co/u/xzhou)\
**Post date:** [November 27, 2018, 2:00pm UTC](https://discuss.elastic.co/t/puppet-elastic-module-and-elasticsearch-yml/157941/3 "2018-11-27T14:00:02Z")

</div>

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  
Services,DC=A,DC=B,DC=C"'

Thanks, xzhou

---

<div class="post-metadata">

**Author:** ![tylerjl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylerjl/32/44965_2.png) [@tylerjl](https://discuss.elastic.co/u/tylerjl)\
**Post date:** [November 27, 2018, 6:24pm UTC](https://discuss.elastic.co/t/puppet-elastic-module-and-elasticsearch-yml/157941/4 "2018-11-27T18:24:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 25, 2018, 6:24pm UTC](https://discuss.elastic.co/t/puppet-elastic-module-and-elasticsearch-yml/157941/5 "2018-12-25T18:24:44Z")

</div>

Closed on December 25, 2018, 6:24pm UTC

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