# Adding Coordinator Hosts over API

**URL:** <https://discuss.elastic.co/t/adding-coordinator-hosts-over-api/102100>\
**Category:** Elastic Cloud Enterprise (ECE)\
**Created:** [September 28, 2017, 10:48am UTC](https://discuss.elastic.co/t/adding-coordinator-hosts-over-api/102100 "2017-09-28T10:48:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lafunamor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lafunamor/32/22571_2.png) [@Lafunamor](https://discuss.elastic.co/u/Lafunamor)\
**Post date:** [September 28, 2017, 10:48am UTC](https://discuss.elastic.co/t/adding-coordinator-hosts-over-api/102100/1 "2017-09-28T10:48:49Z")

</div>

Hi there

I'm currently working on automating the ECE cluster setup and I'm facing the following problem:

I'm generating a new roles-token with the following call:  
acurl -u 'root:password' -H 'Content-Type: application/json' -X POST [http://ece-api:12400/api/v1/platform/configuration/security/enrollment-tokens](http://ece-api:12400/api/v1/platform/configuration/security/enrollment-tokens) -d '{"persistent": false,"roles":["director, coordinator"], "validity\_in\_seconds": 3000000}')  
Then I'm running the installer script with the following arguments:  
--roles-token --roles "director,coordinator"

The runner is successfully added to the ECE cluster and in the UI the following roles are assigned: beats-runner, coordinator, director, services-forwarder  
But only the following containers are running (as reported in UI):  
beats-runner, client-forwarder, runner, services-forwarder

When I remove the coordinator role and add it again using the UI the following containers are reported by the UI:  
admin-console, beats-runner, blueprint, client-forwarder, cloud-ui, constructor, curator, director, runner, services-forwarder, zookeeper

So it seems that when using the script and providing the roles token and the roles, they are not applied properly although the documentation suggest otherwise: [https://www.elastic.co/guide/en/cloud-enterprise/current/ece-installing.html#ece-installing-additional](https://www.elastic.co/guide/en/cloud-enterprise/current/ece-installing.html#ece-installing-additional)

I'm using ECE version 1.0.2

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![gmarz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gmarz/32/22178_2.png) [@gmarz](https://discuss.elastic.co/u/gmarz)\
**Post date:** [September 28, 2017, 11:30am UTC](https://discuss.elastic.co/t/adding-coordinator-hosts-over-api/102100/2 "2017-09-28T11:30:00Z")

</div>

Hi Lafunamor,

The `roles` argument that's passed to the installer script is a comma-delimited string (which you have correct), but the API request to generate the token requires an array.

So you should change it to:

```auto
{
  "persistent": false,
  "roles":["director", "coordinator"], 
  "validity_in_seconds": 3000000
}

```

There is no validation in the API for roles, so it returned a token that isn't actually going to work. Running the install script again with the newly generated token from the corrected request above should fix it.

Greg

---

<div class="post-metadata">

**Author:** ![Lafunamor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lafunamor/32/22571_2.png) [@Lafunamor](https://discuss.elastic.co/u/Lafunamor)\
**Post date:** [September 28, 2017, 1:05pm UTC](https://discuss.elastic.co/t/adding-coordinator-hosts-over-api/102100/3 "2017-09-28T13:05:41Z")

</div>

Hi Greg

Thanks a lot. I totally missed the error.

Works perfectly now.

Lafunamor

---

<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:** [October 12, 2017, 1:06pm UTC](https://discuss.elastic.co/t/adding-coordinator-hosts-over-api/102100/4 "2017-10-12T13:06:32Z")

</div>

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