Skip to content

Instantly share code, notes, and snippets.

@cjellick
Created July 28, 2017 14:16
Show Gist options
  • Save cjellick/19f3782f83a169ddb4d3a074c127e577 to your computer and use it in GitHub Desktop.
Save cjellick/19f3782f83a169ddb4d3a074c127e577 to your computer and use it in GitHub Desktop.
#cloud-config
write_files:
- path: /opt/rancher/bin/start.sh
permissions: "0770"
content: |
#!/bin/sh
cat > /opt/rancher/bin/kickoff.sh << EOF
#!/bin/bash
set -x
while ! docker version >/dev/null 2>&1; do echo 'waiting for docker...'; sleep 2; done
while ! ping -c 1 8.8.8.8 >/dev/null 2>&1; do echo 'waiting for net...'; sleep 2; done
sleep 3
docker run -d --restart=unless-stopped -p 8080:8080 -p 9345:9345 rancher/server:master -e REPOS="https://github.com/cjellick/cattle,origin/md-cache-fix" --db-host *** --db-user *** --db-pass *** --db-name *** --advertise-address `ifconfig eth0 | grep inet | awk {'print $2'} | cut -c6- | head -n 1`
EOF
sudo chmod +x /opt/rancher/bin/kickoff.sh
set +x
sudo sh /opt/rancher/bin/kickoff.sh &
rancher:
network:
dns:
nameservers: ['8.8.4.4', '8.8.8.8']
search:
- example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment