Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation document updates #18249

Merged
merged 3 commits into from Nov 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
185 changes: 101 additions & 84 deletions docsite/rst/intro_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,99 +108,20 @@ You also need Python 2.4 or later. If you are running less than Python 2.5 on th

Installing the Control Machine
``````````````````````````````

.. _from_source:

Running From Source
+++++++++++++++++++

Ansible is trivially easy to run from a checkout, root permissions are not required
to use it and there is no software to actually install for Ansible itself. No daemons
or database setup are required. Because of this, many users in our community use the
development version of Ansible all of the time, so they can take advantage of new features
when they are implemented, and also easily contribute to the project. Because there is
nothing to install, following the development version is significantly easier than most
open source projects.

.. note::

If you are intending to use Tower as the Control Machine, do not use a source install. Please use OS package manager (eg. apt/yum) or pip to install a stable version.


To install from source.

.. code-block:: bash

$ git clone git://github.com/ansible/ansible.git --recursive
$ cd ./ansible

Using Bash:

.. code-block:: bash

$ source ./hacking/env-setup

Using Fish::

$ . ./hacking/env-setup.fish

If you want to suppress spurious warnings/errors, use::

$ source ./hacking/env-setup -q

If you don't have pip installed in your version of Python, install pip::

$ sudo easy_install pip

Ansible also uses the following Python modules that need to be installed [1]_::

$ sudo pip install paramiko PyYAML Jinja2 httplib2 six

Note when updating ansible, be sure to not only update the source tree, but also the "submodules" in git
which point at Ansible's own modules (not the same kind of modules, alas).

.. code-block:: bash

$ git pull --rebase
$ git submodule update --init --recursive

Once running the env-setup script you'll be running from checkout and the default inventory file
will be /etc/ansible/hosts. You can optionally specify an inventory file (see :doc:`intro_inventory`)
other than /etc/ansible/hosts:

.. code-block:: bash

$ echo "127.0.0.1" > ~/ansible_hosts
$ export ANSIBLE_INVENTORY=~/ansible_hosts

.. note::

ANSIBLE_INVENTORY is available starting at 1.9 and substitutes the deprecated ANSIBLE_HOSTS

You can read more about the inventory file in later parts of the manual.

Now let's test things with a ping command:

.. code-block:: bash

$ ansible all -m ping --ask-pass

You can also use "sudo make install" if you wish.

.. _from_yum:

Latest Release Via Yum
++++++++++++++++++++++

RPMs are available from yum for `EPEL
<http://fedoraproject.org/wiki/EPEL>`_ 6, 7, and currently supported
Fedora distributions.
Fedora distributions.

Ansible itself can manage earlier operating
systems that contain Python 2.4 or higher (so also EL5).

Fedora users can install Ansible directly, though if you are using RHEL or CentOS and have not already done so, `configure EPEL <http://fedoraproject.org/wiki/EPEL>`_

.. code-block:: bash

# install the epel-release RPM if needed on CentOS, RHEL, or Scientific Linux
Expand Down Expand Up @@ -242,7 +163,25 @@ Debian/Ubuntu packages can also be built from the source checkout, run:

You may also wish to run from source to get the latest, which is covered above.

.. _from_pkg:
Latest Releases Via Apt (Debian)
++++++++++++++++++++++++++++++++

Debian users may leverage the same source as the Ubuntu PPA.

Add the following line to /etc/apt/sources.list:

.. code-block:: bash

deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main

Then run these commands:

.. code-block:: bash

$ sudo apt-get update
$ sudo apt-get install ansible

.. note:: This method has been verified with the Trusty sources in Debian Jessie and Stretch but may not be supported in earlier versions.

Latest Releases Via Portage (Gentoo)
++++++++++++++++++++++++++++++++++++
Expand Down Expand Up @@ -327,9 +266,9 @@ your version of Python, you can get pip by::
Then install Ansible with [1]_::

$ sudo pip install ansible

Or if you are looking for the latest development version::

pip install git+git://github.com/ansible/ansible.git@devel

If you are installing on OS X Mavericks, you may encounter some noise from your compiler. A workaround is to do the following::
Expand All @@ -347,6 +286,84 @@ Packaging Ansible or wanting to build a local package yourself, but don't want t

These releases are also tagged in the `git repository <https://github.com/ansible/ansible/releases>`_ with the release version.

.. _from_source:

Running From Source
+++++++++++++++++++

Ansible is easy to run from a checkout - root permissions are not required
to use it and there is no software to actually install. No daemons
or database setup are required. Because of this, many users in our community use the
development version of Ansible all of the time so they can take advantage of new features
when they are implemented and easily contribute to the project. Because there is
nothing to install, following the development version is significantly easier than most
open source projects.

.. note::

If you are intending to use Tower as the Control Machine, do not use a source install. Please use OS package manager (like ``apt/yum``) or ``pip`` to install a stable version.


To install from source.

.. code-block:: bash

$ git clone git://github.com/ansible/ansible.git --recursive
$ cd ./ansible

Using Bash:

.. code-block:: bash

$ source ./hacking/env-setup

Using Fish::

$ . ./hacking/env-setup.fish

If you want to suppress spurious warnings/errors, use::

$ source ./hacking/env-setup -q

If you don't have pip installed in your version of Python, install pip::

$ sudo easy_install pip

Ansible also uses the following Python modules that need to be installed [1]_::

$ sudo pip install paramiko PyYAML Jinja2 httplib2 six

Note when updating ansible, be sure to not only update the source tree, but also the "submodules" in git
which point at Ansible's own modules (not the same kind of modules, alas).

.. code-block:: bash

$ git pull --rebase
$ git submodule update --init --recursive

Once running the env-setup script you'll be running from checkout and the default inventory file
will be /etc/ansible/hosts. You can optionally specify an inventory file (see :doc:`intro_inventory`)
other than /etc/ansible/hosts:

.. code-block:: bash

$ echo "127.0.0.1" > ~/ansible_hosts
$ export ANSIBLE_INVENTORY=~/ansible_hosts

.. note::

ANSIBLE_INVENTORY is available starting at 1.9 and substitutes the deprecated ANSIBLE_HOSTS

You can read more about the inventory file in later parts of the manual.

Now let's test things with a ping command:

.. code-block:: bash

$ ansible all -m ping --ask-pass

You can also use "sudo make install".

.. seealso::

:doc:`intro_adhoc`
Expand Down