summaryrefslogtreecommitdiff
path: root/packer/files/answer_files/linux/ubuntu/24.04-server/user-data
blob: 5e02023f33efc5f26dcd0c0129f6156aebfeb4c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#cloud-config
autoinstall:
  version: 1
  early-commands:
    - systemctl stop ssh
  locale: en_US.UTF-8
  keyboard:
    layout: us
    variant: ""
  storage:
    layout:
      name: lvm 
  identity:
    hostname: ubuntu
    username: ubuntu
    password: "$6$R9142dko7PYoTTJP$o19g/Av.dsI/fVEF4SJ8v0XqRcG6YdhQRGYLFrW2X4BG4gO2z3dWyOwio3pRrFXBMHNZHJlZPUp9yvR7elRKs0"
  ssh:
    allow-pw: true
    install-server: true
  user-data:
    disable_root: false
    runcmd:
      - 'echo "root:root" | chpasswd'
  late-commands:
    - rm -rf /target/etc/apt/preferences.d/90curtin.pref
    - curtin in-target --target=/target -- lvextend --extents +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
    - curtin in-target --target=/target -- resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
    - echo 'PermitRootLogin yes' >> /target/etc/ssh/sshd_config
    - chmod -x /target/etc/update-motd.d/*
    - |
      cat << EOF > /target/etc/netplan/99-dhcp-any-interface.yaml
      network:
        ethernets:
          any_interface:
            match:
              name: "e*"
            dhcp4: true
        version: 2
      EOF