-
-
Save funky81/f410e2675ba29374cf23cd744730666f to your computer and use it in GitHub Desktop.
User Data for vSphere Ubuntu Cloud cloud-Init
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
#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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
many bug fixed from previous cloud-init ubuntu script