I wrote an updated version here: https://blog.petermartyniak.com/rancheros-cloud-init-cloud-config-setup-2020-update/

When you create a new RancherOS box, you can use cloud-config.yml file to setup your OS. There are two ways of doing it, with or without installation to the disk.

In memory option:

Create or download your cloud-config.yml file:

sudo ros install -c https://link/to/cloud-config.yml

Install to disk option:

Get the config file as in the previous section, then:

sudo ros install -c cloud-config.yml -d /dev/sda

Kernel params for ESXi 6.7 option:

Edit your Rancher VM open [VM Options] > [Advanced] > [Edit Configuration] and [Add parameter]

Key= guestinfo.cloud-init.config.url

Value= http://your.url/cloud-config.yml

Rancher is going to automatically pick up that config and apply it on boot

The cloud config file:

This file sets the persistent drive, hostname, ssh key, static ip address and custom DNS

#cloud-config
runcmd:
  -  sudo mkfs.ext4 -L RANCHER_STATE /dev/sda
hostname : your-hostname
ssh_authorized_keys:
  - ssh-rsa =your=rsa=key
rancher:
  network:
    interfaces:
      eth*:
        address: ip/netmask
        gateway: gateway
    dns:
      nameservers:
        - nameserver

https://rancher.com/docs/os/v1.2/en/running-rancheros/cloud/vmware-esxi/

https://rancher.com/docs/os/v1.2/en/boot-process/cloud-init/

https://rancher.com/docs/os/v1.2/en/running-rancheros/server/install-to-disk/

https://cloudinit.readthedocs.io/en/latest/topics/examples.html

https://rancher.com/docs/os/v1.x/en/installation/configuration/