XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. ditzy-olive
    3. Best
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 8
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Can't get dns to work with cloud-init on debian11

      @olivierlambert Thanks, just stumbled over this a few minutes ago and tried it, but doesn't work. According to https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting#write-files-to-the-disk

      This currently only works for RHEL-based distributions.

      But this led me to write_files and this works:

      write_files:
        - path: /etc/resolv.conf
          content: |
            domain exmple.com
            search example.com
            nameserver 192.168.20.1
      

      this is the full configuration I use:

      #cloud-config
      hostname: {name}
      timezone: Europe/Vienna
      users:
        - default
        - name: johndow
          passwd: ****
          sudo: ALL=(ALL) NOPASSWD:ALL
          groups: users, admin, sudo
          shell: /bin/bash
          lock_passwd: true
          ssh_authorized_keys:
            - ssh-ed25519 AAAA****
      write_files:
        - path: /etc/resolv.conf
          content: |
            domain example.com
            search example.com
            nameserver 192.168.20.1
      package_update: true
      packages:
        - sudo
        - htop
        - vim
        - python
        - tmux
      package_upgrade: true
      runcmd:
        - sudo reboot
      

      the Network configuration looks like this:

        version: 2
        ethernets:
          eth0:
            match:
              name: eth0
            addresses:
              - 192.168.20.6/28
            gateway4: 192.168.20.1
          eth1:
            match:
              name: eth1
            addresses:
              - 10.10.10.6/24
      

      but now it seems I forgot the MTU but this is a different story, thanks for the hint in the right direction.

      posted in Advanced features
      ditzy-oliveD
      ditzy-olive