2

I need to deploy many systems with an ubuntu installation. I have an Ansible script that installs all the software I need, but before that I need to get ubuntu on these systems. So I want to create an image that automatically installs ubuntu with a specific user/password, ssh and one autorized ssh key in the .ssh folder. I have got this working with Cubic. But I still have to set an user and other settings before installing. How do I get rid of this wizard before installing?

When I create an droplet on digitialOcean I can insert this cloud init thing, I kinda want something similar.

1 Answers1

1

You'll need to create a preseed file to pre-configure your user info.

# Locale
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us

# Clock
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string US/Pacific
d-i clock-setup/ntp boolean true

# Users
d-i passwd/user-fullname string UseYours
d-i passwd/username string UseYours
d-i passwd/user-password-crypted password UseYours/
#d-i passwd/root-login boolean true
#d-i passwd/root-password-crypted password [crypt 3]
#d-i user-setup/allow-password-weak boolean true

(Reference: https://answers.launchpad.net/cubic/+question/681179)

Ensure your preseed file is listed in the boot configurations (file=/cdrom/...). If you simply add to the existing preseed file, then it will already be referenced by the boot configurations.

Also, here is an example Debian preseed file with other possible parameters, in case it's useful to you.

Enterprise
  • 12,792