4

I need to install Ansible Control Machine behind a corporate firewall with no internet access. I can't find documentation for an offline install. I have access on my workstation to download anything I want and can copy it to the target machine. I have tried searching online but have not been able to find examples on how to do this. My server is Ubuntu 14.04 but if anyone has documentation for Red Hat or another distro that would also help.

ajgreyling
  • 1,406
  • 2
  • 13
  • 10
  • 2
    Possible duplicate of [Python Packages Offline Installation](http://stackoverflow.com/questions/11091623/python-packages-offline-installation) – ydaetskcoR Dec 11 '15 at 14:46
  • Ansible can be installed just like any other Python package so http://stackoverflow.com/questions/11091623/python-packages-offline-installation might be of help – ydaetskcoR Dec 11 '15 at 14:47

2 Answers2

2

I did a testing on my RH6, so if you have a RH6 with Internet access to download all required installation file, and a RH6 installation ISO. You should be able to achieve this.

Assuming you have a RH6 which has Internet access, let's call it A. And another one doesn't have access: B.

  1. download Ansible and Jinja2 from A, and copy the files to B. For Ansible: http://docs.ansible.com/ansible/intro_installation.html Jinja2 is required for Ansible, download it here: https://pypi.python.org/pypi/Jinja2

  2. Mount the RH6 installation ISO to your RH6 B, then install the required RPM. In my case, i installed PIP as well:

rpm -ivh python-paramiko-1.7.5-2.1.el6.noarch.rpm libyaml-0.1.3-4.el6_6.x86_64.rpm PyYAML-3.10-3.1.el6.x86_64.rpm perl-TermReadKey-2.30-13.el6.x86_64.rpm perl-Error-0.17015-4.el6.noarch.rpm python-six-1.9.0-2.el6.noarch.rpm

//following required for Git rpm -ivh --force --nodeps perl-Git-1.7.1-3.el6_4.1.noarch.rpm

rpm -ivh git-1.7.1-3.el6_4.1.x86_64.rpm

Note: i didn't install httplib2 here, you can do it later.

  1. install MarkupSafe (required for Jinja2)

//install MarkupSafe

tar -xvf MarkupSafe-0.23.tar.gz

cd MarkupSafe-0.23/

sudo python setup.py install

  1. install Jinja2

//install Jinjia2

tar -xvf Jinja2-2.8.tar.gz

cd Jinja2-2.8/

sudo python setup.py install

  1. On RH6 B, you should be able to run Ansible now:

tar -zxvf ansible.tar.gz

source ./hacking/env-setup

echo "127.0.0.1" > ~/ansible_hosts

export ANSIBLE_INVENTORY=~/ansible_hosts

ansible --version

star
  • 691
  • 7
  • 12
  • Thanks for the detailed answer. The problem is that due to tight security, none of our instances have any access to the internet. This is severely hampering our efforts and I have raised this with the system administrators. I told them that if we are serious about adopting Linux we are going to need dev/Sandbox servers with internet access so we can create containers to be deployed to the secure production servers with no internet access. – ajgreyling Jan 19 '17 at 13:11
  • That's true. Most of the enterprise customers care about the security very seriously and there must have some Dev/AT/SIT/Pre-Prod environments to test the system before go production. It doesn't make sense if they just want to jump to production without any testing... At least you need a jump box can copy the stuffs. Otherwise, you may need to talk to the PM to discuss the solution again. lol – star Jan 20 '17 at 12:12
1

I know this is a very old question, but I've found the answer in this blog post and I believe that could help someone out there.

Although this post aproach is on a CentOS/RHEL machine, I believe the procedure is very similar to other distros:

  1. Download the packages (RPM) dependencies
  2. Download the Ansible packages
  3. Upload the downloaded packages to the target machine
  4. Install it using yum localinstall

Or you could also install it from the source.

Ricardo Zanini
  • 1,041
  • 7
  • 12