# Automated Racher Deploy

**URL:** <https://forums.suse.com/t/automated-racher-deploy/12079>\
**Category:** SUSE Rancher Prime\
**Created:** [October 18, 2018, 3:05pm UTC](https://forums.suse.com/t/automated-racher-deploy/12079 "2018-10-18T15:05:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![amioranza](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/amioranza/32/3053_2.png) [@amioranza](https://forums.suse.com/u/amioranza)\
**Post date:** [October 18, 2018, 3:05pm UTC](https://forums.suse.com/t/automated-racher-deploy/12079/1 "2018-10-18T15:05:09Z")

</div>

Hi Guys,

I’m trying to create a pipeline to recreate all my environment from Jenkins, but the initial Rancher installation needs to setup a password and them create a API Key to use the API to import a cluster created with RKE tool.

There is a way to do the initial setup, password and URL, and API key creation form API?

There is a documentation on how to do it?

Tks.

---

<div class="post-metadata">

**Author:** ![amioranza](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/amioranza/32/3053_2.png) [@amioranza](https://forums.suse.com/u/amioranza)\
**Post date:** [October 22, 2018, 1:09pm UTC](https://forums.suse.com/t/automated-racher-deploy/12079/2 "2018-10-22T13:09:49Z")

</div>

Hi,

There is a way to pass the admin initial password and Rancher endpoint URL via ENV vars when starting Rancher?

This will be very helpful when we are automating the Rancher deploy.

Thanks.

---

<div class="post-metadata">

**Author:** ![amioranza](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/amioranza/32/3053_2.png) [@amioranza](https://forums.suse.com/u/amioranza)\
**Post date:** [October 22, 2018, 6:27pm UTC](https://forums.suse.com/t/automated-racher-deploy/12079/3 "2018-10-22T18:27:57Z")

</div>

Hi!

This [https://github.com/rancher/rancher/issues/15477](https://github.com/rancher/rancher/issues/15477) and this [https://github.com/rancher/rancher/issues/13271](https://github.com/rancher/rancher/issues/13271) with some ideas from here [https://gist.github.com/superseb/c363247c879e96c982495daea1125276](https://gist.github.com/superseb/c363247c879e96c982495daea1125276)

Solved my problem.

---

<div class="post-metadata">

**Author:** ![Fraser\_Goffin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/fraser_goffin/32/6608_2.png) [@Fraser\_Goffin](https://forums.suse.com/u/Fraser_Goffin)\
**Post date:** [November 26, 2018, 1:47pm UTC](https://forums.suse.com/t/automated-racher-deploy/12079/4 "2018-11-26T13:47:14Z")

</div>

Have a look in the Rancher quick start guides. There are example API calls for both.

---

<div class="post-metadata">

**Author:** ![amioranza](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/amioranza/32/3053_2.png) [@amioranza](https://forums.suse.com/u/amioranza)\
**Post date:** [November 28, 2018, 2:15am UTC](https://forums.suse.com/t/automated-racher-deploy/12079/5 "2018-11-28T02:15:18Z")

</div>

Thanks, but I’ve solved the problem using the information on the links i’ve put on my thread. If I know about this Quick Start repo before it would be handful.

Regards.

---

<div class="post-metadata">

**Author:** ![DineshC001](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/dineshc001/32/4629_2.png) [@DineshC001](https://forums.suse.com/u/DineshC001)\
**Post date:** [November 28, 2018, 4:56pm UTC](https://forums.suse.com/t/automated-racher-deploy/12079/6 "2018-11-28T16:56:56Z")

</div>

Does this help - [https://rancher.com/docs/rancher/v2.x/en/faq/technical/#how-can-i-reset-the-admin-password](https://rancher.com/docs/rancher/v2.x/en/faq/technical/#how-can-i-reset-the-admin-password)

---

<div class="post-metadata">

**Author:** ![jeremyweber-np](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jeremyweber-np/32/4190_2.png) [@jeremyweber-np](https://forums.suse.com/u/jeremyweber-np)\
**Post date:** [November 28, 2018, 5:16pm UTC](https://forums.suse.com/t/automated-racher-deploy/12079/7 "2018-11-28T17:16:51Z")

</div>

@ [amioranza](http://forums.suse.com/u/amioranza) care to share more details about your approach on this? I have a slew of shell scripts that call the rancher api and rancher cli in order to provision a cluster in a existing rancher server.

Not really happy with the shell script approach at this point, so curious on how your approach looks.

---

<div class="post-metadata">

**Author:** ![amioranza](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/amioranza/32/3053_2.png) [@amioranza](https://forums.suse.com/u/amioranza)\
**Post date:** [November 28, 2018, 6:31pm UTC](https://forums.suse.com/t/automated-racher-deploy/12079/8 "2018-11-28T18:31:06Z")

</div>

I have shell scripts using curl too, but I run it via Jenkins pipeline. That pipeline have other steps where I use Terraform, Chef and RKE to provision the servers(kubernetes cluster and rancher server) and the final steps is to setup the Rancher and import the new cluster created by RKE.

---

<div class="post-metadata">

**Author:** ![Sarma\_K](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Sarma\_K](https://forums.suse.com/u/Sarma_K)\
**Post date:** [December 17, 2018, 12:58pm UTC](https://forums.suse.com/t/automated-racher-deploy/12079/9 "2018-12-17T12:58:56Z")

</div>

@amioranza & @jeremyweber-np, I had setup an HA cluster with RKE using terraform, rancher API, CLI & shell scripts. But when I am trying to add the custom clusters on top of local cluster, I am frequently getting into this issue:

> <https://github.com/rancher/rancher/issues/15970>
>
> Rancher server version - v2.1.0-rc10
> 
> Steps to reproduce the problem:
> Create …a custom cluster with following configuration:
> 2 control nodes
> 3 etcd nodes
> 3 worker nodes
> 
> Cluster stuck in provisioning state forever with ""Failed to reconcile etcd plane: Failed to create etcd client for host: client: etcd cluster is unavailable or misconfigured"

When I get into this scenario, I had to remove the nodes, the cluster and retry from scratch.

May I know if you have encountered this issue in your setup?

Thanks,  
Sarma K
