Can we provisionned Hosts on openstack using Rancher-API instead of Rancher-UI?

I would like to automate Hosts pre-provisionned with rancher agent like I can do directly with docker-machine, but i don’t want to do it with the UI but directly using Rancher-cli ?


Hi All,

An other way : Can I talk directly to the Rancher API in order to get dynamically the “Add Host” command to un on my docker nodes in order to add rancher-agents to my cluster ?


See Is there a way to create a digital ocean host programmatically?

Hi Sebastian,

i’m not sure if this fits your requirements:

Just run this command on your new docker nodes:

sudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v0.8.2

Obvious you have to “automate” this command after openstack has provisioned your new VM…

This CLI above is for all nodes the same… you just have to click one time on the “add-host” and copy this cli…

Hope that helps…

Hi @Flo_B,

thanks for reply, in fact it is that rancher url that I want to retrieve dynamically (or is this url note limited in time ? if I get this url and used it 2month or 1year later would it be stille valid ?)


There is a setting (not exposed in the UI) to configure the lifetime, it defaults to “forever” (10 years) by default but can be reduced to minutes if you wanted to lock it down.

@vincent thanks for reply, 10 years is ok for me :slight_smile: