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

80 views
Skip to first unread message

Sorin Srbu

unread,
Dec 4, 2018, 8:32:03 AM12/4/18
to Ansible Project
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

Jonathan Lozada De La Matta

unread,
Dec 4, 2018, 8:34:10 AM12/4/18
to ansible...@googlegroups.com
during step 2 is there an option to install extra packages or do extra commands?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1c577530-4378-4d4a-9e0e-94f18bcd36b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Jonathan lozada de la matta

AUTOMATION PRACTICE



 

Sorin Srbu

unread,
Dec 4, 2018, 9:08:46 AM12/4/18
to Ansible Project
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...

Jonathan Lozada De La Matta

unread,
Dec 4, 2018, 9:16:21 AM12/4/18
to ansible...@googlegroups.com
well that's an option but, what I was getting is that either you either get ssh installed somehow or try ansible-pull.


For more options, visit https://groups.google.com/d/optout.

Kai Stian Olstad

unread,
Dec 4, 2018, 10:00:48 AM12/4/18
to ansible...@googlegroups.com
On Tuesday, 4 December 2018 14:32:03 CET Sorin Srbu wrote:
> 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
> 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?

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


--
Kai Stian Olstad


Sorin Srbu

unread,
Dec 5, 2018, 3:34:05 AM12/5/18
to Ansible Project
Thanks. I need to read up on ansible-pull.
I'll be back with more questions after.

Sorin Srbu

unread,
Dec 5, 2018, 3:36:23 AM12/5/18
to Ansible Project
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?

Sorin Srbu

unread,
Dec 5, 2018, 4:35:00 AM12/5/18
to Ansible Project
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.

Dick Visser

unread,
Dec 5, 2018, 6:54:16 AM12/5/18
to ansible...@googlegroups.com
On Wed, 5 Dec 2018 at 10:35, Sorin Srbu <sorin...@gmail.com> wrote:
>
> 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

Sorin Srbu

unread,
Dec 5, 2018, 7:43:02 AM12/5/18
to Ansible Project
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

Kai Stian Olstad

unread,
Dec 5, 2018, 11:08:17 AM12/5/18
to ansible...@googlegroups.com
On Wednesday, 5 December 2018 09:36:22 CET Sorin Srbu wrote:
> 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?

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.


--
Kai Stian Olstad


Sorin Srbu

unread,
Dec 6, 2018, 3:30:29 AM12/6/18
to Ansible Project
Excellent! Thanks.
Reply all
Reply to author
Forward
0 new messages