Using Ansible to setup newly installed Ubuntu-box, no ssh

Hi all,

It goes like this.

  1. I order and buy a bunch of Dell laptops with Ubuntu 16 LTS preinstalled.

  2. I manually go trough the first-install-config.

  3. After reboot, it’s up, and I want to use Ansible from a remote admin-computer to set the laptop up identically for eg a course.

  4. Ansible can’t connect, because it seems Ubuntu 16 doesn’t install and activate ssh by default!
    See https://askubuntu.com/questions/985375/does-ubuntu-desktop-enable-remote-ssh-access-by-default.

  5. I had intented to use Ansible to not have to login manually and install eg ssh and set all the other configs, mounts etc.

Basically, now what?
Feels like this is a chicken and egg situation here.

How do you get around this obstacle when dealing with Ubuntu?

//Sorin

during step 2 is there an option to install extra packages or do extra commands?

Hi and thanks for the reply.

In the installer wizard, like a role picker as in eg CentOS?
Not that I noticed.

I got to choose keyboard, language, time zone and if I wanted to use wifi. Also asked if I wanted to create a rescue usb-stick.
Nothing else that I recall.

I’m getting to think maybe I should’ve researched getting a customized image installed with ssh and have it activated…

well that’s an option but, what I was getting is that either you either get ssh installed somehow or try ansible-pull.

Use PXE boot and provide a preseed file that installes openssh-server.

Thanks. I need to read up on ansible-pull.
I’ll be back with more questions after.

Thanks.
The main reason we ordered the laptops preinstalled with Ubuntu, was to not have to reinstall them again.
This is however an alternative though.

I’ve used netinstall with a local repo with CentOS previously.
Would your suggestion be something similar?

Looking here, re the cron-script;
https://github.com/ansible/ansible-examples/blob/master/language_features/ansible_pull.yml

Ansible needs to be already installed on the new laptop/s, right?
And I can’t do that remotely because I don’t have openssh-server installed and running.

Exactly, so your issue is a generic system administration one about
how to bootstrap your machines up to the point where ansible can be
used.
You need to figure out how to do that, probably by reading the Ubuntu
docs, or probably the vendor (if you'd want to keep the current
installations).
Depending on your local preference you can either use push or pull
mode - each one has different implications wrt what your machines
should look like.
Once you've figured that out, things should just work.

Dick

Yupp, it’s an infrastructure problem - the essence of the poodle or some such.
I need to step back and rethink this.

Thanks for the hints, so far!

//Sorin

Yeah, it more or less the same thing.

So you are probably familiar with Kickstart, Ubuntu installer do support a subset of Kickstart feature so you don't need to use/learn Preseed.

Excellent! Thanks.