Skip to content

Instantly share code, notes, and snippets.

View maradwan's full-sized avatar

Mohamed Radwan maradwan

View GitHub Profile
@maradwan
maradwan / rancher2customnodecmd.sh
Created February 7, 2022 10:41 — forked from superseb/rancher2customnodecmd.sh
Add custom node to Rancher 2.0 (from v2.0.0-alpha26 and up)
#!/bin/bash
docker run -d -p 80:80 -p 443:443 --name rancher-server rancher/rancher:latest
while ! curl -k https://localhost/ping; do sleep 3; done
# Login
LOGINRESPONSE=`curl -s 'https://127.0.0.1/v3-public/localProviders/local?action=login' -H 'content-type: application/json' --data-binary '{"username":"admin","password":"admin"}' --insecure`
LOGINTOKEN=`echo $LOGINRESPONSE | jq -r .token`
# Change password