# Unable to set number\_of\_replicas with Puppet ES module

**URL:** https://discuss.elastic.co/t/unable-to-set-number-of-replicas-with-puppet-es-module/136274
**Category:** Elasticsearch
**Created:** [June 18, 2018, 9:47am UTC](https://discuss.elastic.co/t/unable-to-set-number-of-replicas-with-puppet-es-module/136274 "2018-06-18T09:47:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Alex\_Harvey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_harvey/32/32183_2.png) [@Alex\_Harvey](https://discuss.elastic.co/u/Alex_Harvey)
#### Post date: [June 18, 2018, 9:47am UTC](https://discuss.elastic.co/t/unable-to-set-number-of-replicas-with-puppet-es-module/136274/1 "2018-06-18T09:47:20Z")

</div>

I am trying to build a single-node Elasticsearch 6.3 cluster using the puppet-elasticsearch module.

In the past this worked fine when I declared:

```
elasticsearch::instance { 'es01':
  config => {
    'index.number_of_replicas' => 0,
    ...
  },
}

```

This is apparently no longer valid for ES \>= 5.x

Accordingly I tried this:

```
elasticsearch::template { 'templatename':
  source => 'puppet:///path/to/template.json',
}

```

And my template has:

```
{
  "settings": {
    "index": {
      "number_of_replicas": 0
    }
  }
}

```

(Amongst other stuff.)

That still doesn't work, and my cluster comes up in yellow state, and I can fix it on the command line using:

`curl -XPUT 0.0.0.0:9200/_all/_settings -H'Content-Type: application/json' -d '{"index.number_of_replicas":0}'`

If someone can tell me what I'm doing wrong it would be much appreciated.

---

<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: [June 18, 2018, 10:49pm UTC](https://discuss.elastic.co/t/unable-to-set-number-of-replicas-with-puppet-es-module/136274/2 "2018-06-18T22:49:12Z")

</div>

I think you [may be missing `index_patterns` in your template to make it a valid index template](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html#indices-templates)?

An invalid index template _should_ bubble up from the Puppet catalog run to indicate an invalid `elasticsearch_template` resource as well; does the Puppet run return any errors when you try and apply the template resource?

---

<div class="post-metadata">

### Author: ![Alex\_Harvey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_harvey/32/32183_2.png) [@Alex\_Harvey](https://discuss.elastic.co/u/Alex_Harvey)
#### Post date: [June 21, 2018, 11:47am UTC](https://discuss.elastic.co/t/unable-to-set-number-of-replicas-with-puppet-es-module/136274/3 "2018-06-21T11:47:39Z")

</div>

Yes, I was actually missing that field, among other problems. After fixing that, I then reverted to the latest default Logstash Elasticsearch 6.x output template, and then I had to fix some quoting, as I documented in this bug here: [https://github.com/elastic/puppet-elasticsearch/issues/957](https://github.com/elastic/puppet-elasticsearch/issues/957) This issue here could be closed.

---

<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: [July 19, 2018, 11:47am UTC](https://discuss.elastic.co/t/unable-to-set-number-of-replicas-with-puppet-es-module/136274/4 "2018-07-19T11:47:43Z")

</div>

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