I'm trying to provision a VM with cloud-init and the server live image. (I'm not using the cloud image, for infrastructural reasons I have to install from ISOs)
However, whenever I'm trying to combine autoinstall with e.g. write_files, the write_files part does not seem to succeed.
The following installs Ubuntu:
#cloud-config
autoinstall:
version: 1
identity:
hostname: boxy-001
password: "$1$k46kl1..."
username: alice
storage:
layout:
name: lvm
ssh:
install-server: true
authorized-keys:
- "ecdsa-sha2-nistp256 AAAAE2...."
write_files:
- content: |
cloud_init_has_run
path: /cloud_init_flag
But the file is not written at /cloud_init_flag.
Are modules missing? Is cloud-config incomplete on the Server live ISOs?
Edit the file is written, but it's written in the installation environment! Instead, I should likely use the autoinstall.user-data key to provide the user-data for the target system.
write_filesconfig works for me using the20.04live server installer. Is the rest of theautoinstallworking? How are you confirming the file is missing? – Andrew Lowther Jun 08 '21 at 16:21/cloud_init_flagis actually created? – Tom Jun 09 '21 at 07:51write_filessection and added it to myuser-datafile. I started an install and opened a shell in the installer environment. The/cloud_init_flagwas created with the configured content. My guesses: 1. your autoinstall file is not being used at all. 2. your autoinstall file is invalid and not getting parsed. 3. you expect the file to be on the installed system when it is just on the installation environment – Andrew Lowther Jun 10 '21 at 14:31autoinstall? – Tom Jun 21 '21 at 09:16