[11:23] hello! what is a best way to give an instance a random hostname? [11:23] now i'm doing something like this: [11:23] #!/bin/bash [11:23] HOST=my-random-host-name-${RANDOM} [11:23] DOMAIN=localdomain [11:23] hostnamectl set-hostname ${HOST} [11:23] sed -i "s/^preserve_hostname:.*/preserve_hostname: true" /etc/cloud/cloud.cfg [11:23] sed -i "s/^127.0.0.1.*/127.0.1.1\t${HOST}.${DOMAIN} ${HOST}\n127.0.0.1\tlocalhost/" /etc/hosts [11:23] i want to start using #cloud-config configuration [17:38] slawomir (now gone) should probably be thinking about using jinja template header in cloud-config userdata like the following [17:38] ## template: jinja [17:38] #cloud-config [17:38] {% set HN = 'myhost-' ~ cloud_name ~ '-' ~ region ~ '-' ~ range(1,100) | random %} [17:38] hostname: {{ HN }} [17:40] falcojr: holmanb aciba: 23.4 will be blocked by https://github.com/canonical/cloud-init/issues/4630. init-local timeframe before datasource is detected (in DataSourceNone case) we can't write network-config.json to /v/l/c/instance/network-config.json because the datasource is yet to be detected. This affects subiquity/autoinstall. I'm working a fix and should have a PR up within an hour [17:40] -ubottu:#cloud-init- Issue 4630 in canonical/cloud-init "'failed stage init-local' while testing autoinstall on Noble" [Open] [17:40] I can reproduce this on live-server install images. dbungert heads up as you talked internally about this potential issue. [17:40] blackboxsw: saw that, thanks! [17:56] repeated msg: slawomir (now gone) should probably be thinking about using jinja template header in cloud-config userdata like the following [17:56] 10:38 ## template: jinja [17:56] 10:38 #cloud-config [17:56] 10:38 {% set HN = 'myhost-' ~ cloud_name ~ '-' ~ region ~ '-' ~ range(1,100) | random %} [17:56] 10:38 hostname: {{ HN }} [17:56] meh missed it. will table that for random hostname for now [19:16] falcojr: holmanb I'm testing this now https://github.com/canonical/cloud-init/pull/4635 [19:16] -ubottu:#cloud-init- Pull 4635 in canonical/cloud-init "bug(schema): do not write network-config when instance dir absent" [Open]