Hi,
I am attempting (just using bash at the moment) to automate the deployment of a server and x agents in Openstack.
This seems to work to a point (just working out the pattern/workflow)
I can provision a server, (using cloud-init) and startup a RancherOS + Rancher Server, this works fine.
I then run the following commands to attempt to setup all the required tokens etc… (if the server has an external IP, and I want it use the internal ip:
curl -s "http://$IP:$PORT/v2-beta/settings/api.host" -X PUT -H 'content-type: application/json' --data @configapi_updated.json
Then ask to create the registration token:
curl -s -X POST "http://$IP:$PORT/v1/registrationtokens?projectId=1a5"
Then I can get the details:
curl -s -X GET "http://$IP:$PORT/v1/registrationtokens?projectId=1a5" | jq -r '.data[0].command'
to put into the cloud-init of the agent.
If I then startup the agent I get the following errors in the log of the server.
2017-10-31 09:44:33,046 ERROR [:] [] [] [] [TaskScheduler-1] [i.c.p.a.s.ping.impl.PingMonitorImpl ] Failed to get ping from agent [1] count [3]
2017-10-31 09:44:38,050 ERROR [:] [] [] [] [TaskScheduler-1] [i.c.p.a.s.ping.impl.PingMonitorImpl ] Failed to get ping from agent [1] count [4]
2017-10-31 09:44:43,052 ERROR [:] [] [] [] [TaskScheduler-1] [i.c.p.a.s.ping.impl.PingMonitorImpl ] Failed to get ping from agent [1] count [5]
2017-10-31 09:44:48,053 ERROR [:] [] [] [] [TaskScheduler-1] [i.c.p.a.s.ping.impl.PingMonitorImpl ] Failed to get ping from agent [1] count [6]
However, if I manually (via the UI) click the add host button (and not run the above curl commands)… Then use that link and put it in the cloud init… it all works??
What steps am i missing that the UI does behind the scenes, that I need to do programmatically?
Thanks