Configure isolated servers without Internet access

45 views
Skip to first unread message

David Li

unread,
Aug 12, 2016, 12:10:28 AM8/12/16
to Ansible Project, dlipubkey
Hi,

I am relatively new to Ansible. I need to use Ansible from a dev laptop to set up some servers (both Ubuntu and Centos) that are isolated without any Internet access. The laptop has Internet access for development and it can ssh into these servers. 

I wonder what's the best practice in this case. I am trying to avoid setting a mirror repo on the laptop.  I am also trying to avoid manually figuring out all the packages along with their dependencies. Is there any way that Ansbile modules (such as yum or apt) can help to download and assemble all packages on the laptop and then copy and install them on the servers?

Thanks.

David

Mark Janssen

unread,
Aug 12, 2016, 7:50:29 AM8/12/16
to ansible...@googlegroups.com, dlipubkey
You can setup a web-proxy on your laptop, and configure that (temporarily) as a proxy on the systems you are managing.

--
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-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b6188760-511a-49c6-995f-6933fbc8a999%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mark Janssen  --  maniac(at)maniac.nl
Unix / Linux Open-Source and Internet Consultant
Maniac.nl Sig-IO.nl Vps.Stoned-IT.com

Marcus Franke

unread,
Aug 12, 2016, 9:48:38 AM8/12/16
to ansible...@googlegroups.com
On Thu, Aug 11, 2016 at 08:30:34PM -0700, David Li wrote:
> Hi,
>
> I am relatively new to Ansible. I need to use Ansible from a dev laptop to
> set up some servers (both Ubuntu and Centos) that are isolated without any
> Internet access. The laptop has Internet access for development and it can
> ssh into these servers.

Usually with servers in a protected setup without direct access you have
internal repository servers, that will carry the packages for your servers.

But you could fire up such a repository on your own laptop and configure the
servers to connect to your laptop. For RPM based distributions like CentOS
have a look into the createrepo command. "createrepo --update ." inside a
directory containing an rpm file will create the necessary infrastructure.

If you expose this directory using a webserver you're all done. Now you can
use ansibles yum_repository command like:

- name: Add repository
yum_repository:
name: my_laptops_repository
description: my repo
baseurl: http://my_laptop.example.com/pub/repository

And you are ready and setup to install software from this ..

For a one shot operation this may be possible, but for larger setups I would
recommend to install a repository server that your servers can connect to.

Btw. for debian packages for Ubuntu this would work in similar ways. Ansible
has an apt_repository module for a longer time than the yum_repository one.


Regards,
Marcus

Reply all
Reply to author
Forward
0 new messages