Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- V4_PRIVATE_IP=`wget -q -O - http://169.254.169.254/current/meta-data/local-ipv4`
- V4_PUBLIC_IP=`wget -q -O - http://169.254.169.254/current/meta-data/public-ipv4`
- cat > "cloud-config.yaml" <<EOF
- #cloud-config
- hostname: ptl-www-rancher
- ssh_authorized_keys:
- - ssh-rsa AAAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....
- write_files:
- - path: /home/rancher/.docker/config.json
- permissions: "0600"
- content: |
- {"auths": {"https://index.docker.io/v1/": {"auth": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "email": "[email protected]"}}}
- - path: /etc/ssh/sshd_config
- permissions: "0600"
- owner: root:root
- content: |
- Port 2222
- AuthorizedKeysFile .ssh/authorized_keys
- UsePrivilegeSeparation sandbox
- ClientAliveInterval 180
- Subsystem sftp /usr/libexec/sftp-server
- UseDNS no
- PermitRootLogin no
- AllowGroups docker
- rancher:
- cloud_init:
- datasources:
- - ec2
- network:
- dns:
- nameserver:
- - 8.8.4.4
- - 4.2.2.3
- interfaces:
- eth0:
- dhcp: true
- eth1:
- address: $V4_PRIVATE_IP/16
- mtu: 1450
- state:
- fstype: auto
- dev: LABEL=RANCHER_STATE
- autoformat:
- - /dev/vda
- EOF
- sudo ros install --no-reboot -f -c cloud-config.yaml -d /dev/vda
- sudo reboot
Advertisement
Add Comment
Please, Sign In to add comment