ubuntu-20.04cloud-init

cloud-init won't update ubuntu packages at the end of autoinstall


I am trying to make auto install with PXE boot, the boot no problem but i use cloud-init to preform the automatic installation and run in to some problems one of them is that i want a fully upgraded machine after the auto install so i added package_update: true, package_upgrade: true but this doesn't work. What am i doing wrong here is my user-data file:

#cloud-config
autoinstall:
  version: 1
  identity:
    hostname: ubuntu-server
    password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
    username: a
  packages:
    - postfix
    - ca-certificates
    - apt-transport-https
    - gnupg2
    - screen
    - net-tools
    - open-vm-tools
  final_message: "The system is finally up, after $UPTIME seconds"
  apt:
     package_update: true
     package_upgrade: true
     sources:
   <removed>
  packages:
    - some-install
bootcmd:
  - [wget,"http://some.server/cloud-init/post-install.sh", -O, /root/post-install.sh]

Solution

  • The problem was a bug in ubuntu, i don't witch one but it was fixed 22.04 .

    The work around was running a script that update did the update with bootcmd

    not a nice solution but it works