# How to add a custom host using Rancher CLI

**URL:** <https://forums.suse.com/t/how-to-add-a-custom-host-using-rancher-cli/6919>\
**Category:** Rancher 1.x\
**Created:** [July 22, 2017, 5:51am UTC](https://forums.suse.com/t/how-to-add-a-custom-host-using-rancher-cli/6919 "2017-07-22T05:51:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bga](https://avatars.discourse-cdn.com/v4/letter/b/9f8e36/32.png) [@bga](https://forums.suse.com/u/bga)\
**Post date:** [July 22, 2017, 5:51am UTC](https://forums.suse.com/t/how-to-add-a-custom-host-using-rancher-cli/6919/1 "2017-07-22T05:51:09Z")

</div>

Hi there,

This is ma first post in this forums and I want to say hello…

I searched a bit within this forum but I couldn’t find anything related to my topic.

I’m actually trying to automatically deploy a pretty complex web application using terraform for the cloud provider architecture, rancher cli for the rancher part all wrapped within shell scripts.

I need to automatically add a “custom host” in the rancher UI using rancher-cli or a shell script. I have already tried something curl requests I found using search engines but I haven 't come to a solution yet.  
Is there some way to get the rancher authentication token for the docker rund command by rancher-cli?

Other questions which are open are:

- how can I automatically deploy a Rancher LoadBalancer?

- How can I define a predefined startup procedure as the depends\_on in docker compose files gets filtered out when I import it in Rancher.

- Is it also somehow possible to predefine Health Check rules for an automated deployment?

Hopefully this was not too much for my first post.

---

<div class="post-metadata">

**Author:** ![Tarun\_Prakash](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@Tarun\_Prakash](https://forums.suse.com/u/Tarun_Prakash)\
**Post date:** [December 27, 2017, 9:31am UTC](https://forums.suse.com/t/how-to-add-a-custom-host-using-rancher-cli/6919/2 "2017-12-27T09:31:50Z")

</div>

Hey bga

Did you get a solution for it? We are also having a similar requirement. Our hosts automatically added into existing ENV using aws auto-scaling.  
However, if we want to create new ENV in rancher using CLI and look to add a custom host, we need CLI option.

Let us know if you have figured out.

–Tarun Prakash

---

<div class="post-metadata">

**Author:** ![bga](https://avatars.discourse-cdn.com/v4/letter/b/9f8e36/32.png) [@bga](https://forums.suse.com/u/bga)\
**Post date:** [December 27, 2017, 9:57am UTC](https://forums.suse.com/t/how-to-add-a-custom-host-using-rancher-cli/6919/3 "2017-12-27T09:57:23Z")

</div>

Hi

I managed it using terraform for deployment. It provides a Rancher  
Provider. Afterwards additional Hosts are managed using ansible.  
Using scaling based in monitoing i added a Hook URL which gets triggered by  
Monitoring app anderen then increases Thema amount of Servers anderen  
afterwards increases Thema Numbers of docker instances managed by rancher.

Hope u got the idea

Best

---

<div class="post-metadata">

**Author:** ![Tarun\_Prakash](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@Tarun\_Prakash](https://forums.suse.com/u/Tarun_Prakash)\
**Post date:** [December 27, 2017, 10:58am UTC](https://forums.suse.com/t/how-to-add-a-custom-host-using-rancher-cli/6919/4 "2017-12-27T10:58:33Z")

</div>

This link ([https://github.com/rancher/rancher/issues/4248](https://github.com/rancher/rancher/issues/4248)) helped me.  
I have tested it, working well for me.
