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

**URL:** <https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [December 4, 2018, 1:32pm UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191 "2018-12-04T13:32:03Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sorin\_Srbu](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Sorin\_Srbu](https://forum.ansible.com/u/Sorin_Srbu)\
**Post date:** [December 4, 2018, 1:32pm UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/1 "2018-12-04T13:32:03Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [December 4, 2018, 1:33pm UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/2 "2018-12-04T13:33:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sorin\_Srbu](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Sorin\_Srbu](https://forum.ansible.com/u/Sorin_Srbu)\
**Post date:** [December 4, 2018, 2:08pm UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/3 "2018-12-04T14:08:46Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [December 4, 2018, 2:16pm UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/4 "2018-12-04T14:16:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [December 4, 2018, 3:00pm UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/5 "2018-12-04T15:00:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sorin\_Srbu](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Sorin\_Srbu](https://forum.ansible.com/u/Sorin_Srbu)\
**Post date:** [December 5, 2018, 8:34am UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/6 "2018-12-05T08:34:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sorin\_Srbu](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Sorin\_Srbu](https://forum.ansible.com/u/Sorin_Srbu)\
**Post date:** [December 5, 2018, 8:36am UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/7 "2018-12-05T08:36:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Sorin\_Srbu](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Sorin\_Srbu](https://forum.ansible.com/u/Sorin_Srbu)\
**Post date:** [December 5, 2018, 9:35am UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/8 "2018-12-05T09:35:00Z")

</div>

Looking here, re the cron-script;  
[https://github.com/ansible/ansible-examples/blob/master/language\_features/ansible\_pull.yml](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.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [December 5, 2018, 11:53am UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/9 "2018-12-05T11:53:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sorin\_Srbu](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Sorin\_Srbu](https://forum.ansible.com/u/Sorin_Srbu)\
**Post date:** [December 5, 2018, 12:43pm UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/10 "2018-12-05T12:43:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [December 5, 2018, 4:08pm UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/11 "2018-12-05T16:08:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sorin\_Srbu](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Sorin\_Srbu](https://forum.ansible.com/u/Sorin_Srbu)\
**Post date:** [December 6, 2018, 8:30am UTC](https://forum.ansible.com/t/using-ansible-to-setup-newly-installed-ubuntu-box-no-ssh/29191/12 "2018-12-06T08:30:29Z")

</div>

Excellent! Thanks.
