Skip to content

Instantly share code, notes, and snippets.

@jenrik
Last active November 21, 2021 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenrik/9717a072090bfc5fea8e811e7205dd88 to your computer and use it in GitHub Desktop.
Save jenrik/9717a072090bfc5fea8e811e7205dd88 to your computer and use it in GitHub Desktop.
Rancher Ubuntu 20.04 cloud-init
#cloud-config
groups:
- docker
users:
- default
- name: ubuntu
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCvu0XjgnnODcPW2/g2A63Q9L8nKO1LHx5xAdGEa+YH6SPJYncGYGoW2CfckwnQYPYy1vdWli1ZDnvtn0WIpUIRbyp06aQzX7+Iq/hoae0iRcSYXwRlBgAnYzATmXk7Vby/C5oX8yqoTlmSSjkbynRePLm4xvUoPjDir9Lct6xKeeb0hhJgmc4fByEwgP8LD6MjnViuLHjezScqbgfmKnl4bBVfJIJaOm3IGY4/ps2nH3zPVq1rtFkwqKKSjN374GQ6c8DW1+uBib4SfX8UplLCHt66bsrEZLlTfbYoOAdanbgar9OuzjveENa8wTnj3vON8OW5GhmrOhwPt8CfsOoXTbjM87zPnXkFkg1OS+QuEkwtM3y2KcFKE0ME/tHdBZekkII7NqpUn9WvWoDk+HexeIgfm9ZAgkywdcrObLlCqHreQKTuz5f7gDnUgq7fpYueMc6u03x5gsdVVpszuQwH7YjajD+8YATMsCjP8c85EKL0Nzhs2nSOzL/hMxUm9g6kw4uUXAP3wql7Qf4i24NVWmtd8QXABjXMSYzXw3Xf7619Q3/YadLCiDmmi5ArQjNtIwuL19OHNMjLobvOVIXnksGqABfpkOd9EXKRxCI9sWKb+tmvzAAX+T50l2TSfgdL/dwQIUXkasd8ZpIjXQqOmTh/hegVYtr1Bv0x+vMORQ==
sudo: ALL=(ALL) NOPASSWD:ALL
groups: sudo, docker
shell: /bin/bash
random_seed:
file: /dev/urandom
command: ["pollinate", "-r", "-s", "https://entropy.ubuntu.com"]
command_required: true
package_upgrade: true
runcmd:
- apt -y autoremove
- apt clean
- swapoff --all
- sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
- sysctl net.bridge.bridge-nf-call-iptables=1
- sysctl net.bridge.bridge-nf-call-ip6tables=1
- 'echo "disable_vmware_customization: false" >> /etc/cloud/cloud.cfg'
- sed -i 's/D \/tmp 1777 root root -/#D \/tmp 1777 root root -/g' /usr/lib/tmpfiles.d/tmp.conf
- echo -n > /etc/machine-id
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