I wanted to post my progress for posterity sake:
OK, so I did that and I’m liking how this works.
I added the user to the /etc/maas/preseeds/curtin_userdata_custom
file so that the configuration we’re adding applies to the custom images we’re using vs everything.
At first it failed. Completely. I checked the cloud-init logs on the ephemeral test host and found no references to the stuff I placed in my config. In fact, the file I told it to write out did not exist on the test machine. I was very confused.
I decided to run a linter on the altered curtin_userdata_custom
file and I found and fixed a couple of mildly innocuous things, so I thought. The only thing I really ignored was the line-length warnings. Saved and ran another test.
Bang! Progress. I wasn’t completely out of the woods yet. I needed to polish. A few things I took away for lessons learned:
- Make sure the file you intended to write out on the finally-booted ephemeral host is there IE
/etc/cloud/cloud.cfg.d/<file>
. If it’s not, something is likely wrong with your stuff you changed in the preseeds config template(s). - If the finally-booted ephemeral machine is writing the config but you’re not seeing the user(s) you intended to add, check the cloud-init logs IE
/var/log/cloud*log
and search for username. Pay attention to errors foruseradd
. My initial user addition failed because I specified an selinux group on an image where selinux was disabled. The useradd failed because of that.