Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


fortgeschrittene:cloud-init

ISO-Datei für cloud-init erzeugen

mkdir cloud-init
cloud-init/meta-data
hostname: vm2
instance-id: debian-12-genericcloud-amd64
cloud-init/user-data
#cloud-config
users:
  - name: nutzer
    expiredate: '2037-09-01'
    lock_passwd: false
    sudo: ALL=(ALL) NOPASSWD:ALL
    plain_text_passwd: 'villa'
    shell: /bin/bash
    ssh_authorized_keys:
      - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP4YVUx3HYqDuH3W4ZVj/QGVGWzDjkWLDLaCvdxMLuE7 Ingo
  - name: root
    lock_passwd: false
    plain_text_passwd: 'vogelsang'
runcmd:
- sed -ri 's/^(PasswordAuthentication.*)/#\1/' /etc/ssh/sshd_config
- systemctl restart ssh.service
- hostnamectl set-hostname "vm2"
cloud-init/network-config
version: 2
ethernets:
  enp1s0:
    match:
      macaddress: "52:54:00:00:01:02"
    set-name: enp1s0
    addresses:
      - 192.168.229.102/24
    gateway4: 192.168.229.1
    nameservers:
      search: [linuxhotel.de]
      addresses: [192.168.1.5]

ISO erzeugen:

xorriso -as mkisofs -output cloud-init.iso -volid cidata -rational-rock -joliet cloud-init/*

Doku: https://cloudinit.readthedocs.io/en/latest/index.html

fortgeschrittene/cloud-init.txt · Zuletzt geändert: 2025/08/12 08:45 von ingo_wichmann