Skip to content

Instantly share code, notes, and snippets.

@clemenko
Last active February 2, 2026 00:39
Show Gist options
  • Select an option

  • Save clemenko/efcbaebc772f02bc541463c52ba61a0f to your computer and use it in GitHub Desktop.

Select an option

Save clemenko/efcbaebc772f02bc541463c52ba61a0f to your computer and use it in GitHub Desktop.
A cloud_init example for Harvester and Rocky/Ubuntu

My current Cloud Init

In case you are curious the password hashed is "Pa22word".

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

for harvester

#cloud-config
disable_root: false
packages:
  - vim
  - sudo
  - qemu-guest-agent
  - rsync
runcmd:
  - |
    if grep -q "Ubuntu" /etc/os-release; then
      echo "Ubuntu"
      apt update
      apt install -y htop jq
    elif grep -q "Rocky" /etc/os-release; then
      echo "Rocky"
      yum install -y epel-release bind-utils && yum install -y htop jq
      systemctl disable --now cockpit.service cockpit.socket
      yum remove -y cockpit-bridge cockpit-system cockpit-ws rpcbind
    else
      echo "everything else"
      sysctl -w net.ipv6.conf.all.disable_ipv6=1
      systemctl daemon-reload && systemctl enable --now qemu-guest-agent
    fi
ssh_pwauth: True
users:
  - name: root
    hashed_passwd: $y$j9T$DojILh7bRAyMI.tu2YpUF0$mSc.GGnnazsSQebP8n1DvUJZxY2uLFCniPDJWz8zxpB
    lock_passwd: false
    shell: /bin/bash
    ssh_authorized_keys:
      - ssh-ed25519
        AAAAC3NzaC1lZDI1NTE5AAAAIFJzDQSc2ckhjcf0HqDUJUbF3kdqwJtViW3o7SWSIbf9
        [email protected]
ssh_authorized_keys:
  - |
    ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA26evmemRbhTtjV9szD9SwcFW9VOD38jDuJmyYYdqoqIltDkpUqDa/V1jxLSyrizhOHrlJtUOj790cxrvInaBNP7nHIO+GwC9VH8wFi4KG/TFj3K8SfNZ24QoUY12rLiHR6hRxcT4aUGnqFHGv2WTqsW2sxz03z+W1qeMqWYJOUfkqKKs2jiz42U+0Kp9BxsFBlai/WAXrQsYC8CcpQSRKdggOMQf04CqqhXzt5Q4Cmago+Fr7HcvEnPDAaNcVtfS5DYLERcX2OVgWT3RBWhDIjD8vYCMBBCy2QUrc4ZhKZfkF9aemjnKLfLcbdpMfb+r7NwJsVQSPKcjYAJOckE8RQ== [email protected]

Network

network:
  version: 1
  config:
    - type: physical
      name: eth0
      subnets:
        - type: dhcp

Images

https://dl.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2

https://cloud-images.ubuntu.com/minimal/releases/noble/release/ubuntu-24.04-minimal-cloudimg-amd64.img

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