Last active
August 11, 2017 09:35
-
-
Save manno/de4f3ea19b95d6009eaa8ecb992f0148 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # https://github.com/cloudfoundry/bosh-deployment/blob/master/docs/bosh-lite-on-vbox.md | |
| set -e | |
| # cd ~/co && git clone https://github.com/cloudfoundry/bosh-deployment/ | |
| BOSH_DIR=~/co/bosh-deployment | |
| # locally built cli? | |
| #alias bosh-cli=~/go/src/github.com/cloudfoundry/bosh-cli/out/bosh | |
| bosh-cli int $BOSH_DIR/bosh.yml \ | |
| --var-errs \ | |
| --var-errs-unused \ | |
| -o $BOSH_DIR/virtualbox/cpi.yml \ | |
| -o $BOSH_DIR/virtualbox/outbound-network.yml \ | |
| -o $BOSH_DIR/bosh-lite.yml \ | |
| -o $BOSH_DIR/bosh-lite-runc.yml \ | |
| -o $BOSH_DIR/local-bosh-release.yml \ | |
| -o $BOSH_DIR/jumpbox-user.yml \ | |
| --vars-store ./creds.yml \ | |
| -v director_name="Bosh Lite Director" \ | |
| -v internal_ip=192.168.50.6 \ | |
| -v internal_gw=192.168.50.1 \ | |
| -v internal_cidr=192.168.50.0/24 \ | |
| -v local_bosh_release="local-bosh-release.tar.gz" \ | |
| -v outbound_network_name=NatNetwork | tee bosh.yml | |
| #BOSH_LOG_LEVEL=debug | |
| bosh-cli create-env bosh.yml --vars-store creds.yml --state state.json | |
| # secrets | |
| bosh-cli -e 192.168.50.6 --ca-cert <(bosh-cli int ./creds.yml --path /director_ssl/ca) alias-env vbox | |
| bosh-cli int ./creds.yml --path /jumpbox_ssh/private_key > id_rsa | |
| chmod 600 id_rsa | |
| # direnv | |
| cat > .envrc <<EOF | |
| export BOSH_CLIENT=admin | |
| export BOSH_CLIENT_SECRET=`bosh-cli int ./creds.yml --path /admin_password` | |
| export BOSH_ENVIRONMENT=vbox | |
| EOF | |
| # ssh | |
| echo "TODO add to .ssh/config" | |
| echo <<EOF | |
| Host 192.168.50.6 | |
| StrictHostKeyChecking no | |
| UserKnownHostsFile /dev/null | |
| IdentitiesOnly=yes | |
| User jumpbox | |
| LogLevel QUIET | |
| EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment