Skip to content

Instantly share code, notes, and snippets.

@funky81
Forked from mylesagray/user-data
Last active February 15, 2020 07:47
Show Gist options
  • Save funky81/f410e2675ba29374cf23cd744730666f to your computer and use it in GitHub Desktop.
Save funky81/f410e2675ba29374cf23cd744730666f to your computer and use it in GitHub Desktop.
User Data for vSphere Ubuntu Cloud cloud-Init
#cloud-config
package_update: true
package_upgrade: true
package_reboot_if_required: true
chpasswd:
list: |
ubuntu:VMware1!
expire: false
groups:
- docker
users:
- default
- name: ubuntu
ssh-authorized-keys:
- ssh-rsa
sudo: ALL=(ALL) NOPASSWD:ALL
groups: sudo, docker
shell: /bin/bash
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
runcmd:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- apt-get update -y
runcmd:
- curl -fsSL https://get.docker.com -o get-docker.sh; sh get-docker.sh
- systemctl start docker
- systemctl enable docker
- sudo docker run -d --restart=unless-stopped-p 80:80 -p 443:443 -v /opt/rancher:/var/lib/rancher -v /var/log/rancher/auditlog:/var/log/auditlog -e AUDIT_LEVEL=1 rancher/rancher:latest
write_files:
- content: |
{
"registry-mirrors": ["https://registry.drc.ebays.co.id"]
},
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
path: /etc/docker/daemon.json
final_message: "The system is prepped, after $UPTIME seconds"
@funky81
Copy link
Author

funky81 commented Feb 9, 2020

many bug fixed from previous cloud-init ubuntu script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment