mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
226 lines
8.1 KiB
ReStructuredText
226 lines
8.1 KiB
ReStructuredText
11 years ago
|
Installation
|
||
|
============
|
||
13 years ago
|
|
||
12 years ago
|
.. contents::
|
||
|
:depth: 2
|
||
|
|
||
11 years ago
|
.. _getting_ansible:
|
||
|
|
||
11 years ago
|
Getting Ansible
|
||
|
```````````````
|
||
|
|
||
|
You may also wish to follow the `Github project <https://github.com/ansible/ansible>`_ if
|
||
|
you have a github account. This is also where we keep the issue tracker for sharing
|
||
|
bugs and feature ideas.
|
||
|
|
||
11 years ago
|
.. _what_will_be_installed:
|
||
|
|
||
11 years ago
|
Basics / What Will Be Installed
|
||
11 years ago
|
```````````````````````````````
|
||
13 years ago
|
|
||
11 years ago
|
Ansible by default manages machines over the SSH protocol.
|
||
13 years ago
|
|
||
11 years ago
|
Once ansible is installed, it will not add a database, and there will be no daemons to start or keep running. You only need to install it on one machine (which could easily be a laptop) and it can manage an entire fleet of remote machines from that central point. When Ansible manages remote machines, it does not leave software installed or running on them, so there's no real question about how to upgrade Ansible when moving to a new version.
|
||
13 years ago
|
|
||
11 years ago
|
.. _what_version:
|
||
|
|
||
11 years ago
|
What Version To Pick?
|
||
|
`````````````````````
|
||
13 years ago
|
|
||
11 years ago
|
Because it runs so easily from source and does not require any installation of software on remote
|
||
|
machines, many users will actually track the development version.
|
||
13 years ago
|
|
||
11 years ago
|
Ansible's release cycles are usually about two months long. Due to this
|
||
|
short release cycle, minor bugs will generally be fixed in the next release versus maintaining
|
||
11 years ago
|
backports on the stable branch. Major bugs will still have maintenance releases when needed, though
|
||
11 years ago
|
these are infrequent.
|
||
|
|
||
|
If you are wishing to run the latest released version of Ansible and you are running Red Hat Enterprise Linux (TM), CentOS, Fedora, Debian, or Ubuntu, we recommend using the OS package manager.
|
||
12 years ago
|
|
||
11 years ago
|
For other installation options, we recommend installing via "pip", which is the Python package manager, though other options are also available.
|
||
|
|
||
|
If you wish to track the development release to use and test the latest features, we will share
|
||
11 years ago
|
information about running from source. It's not necessary to install the program to run from source.
|
||
11 years ago
|
|
||
11 years ago
|
.. _control_machine_requirements:
|
||
|
|
||
11 years ago
|
Control Machine Requirements
|
||
|
````````````````````````````
|
||
12 years ago
|
|
||
11 years ago
|
Currently Ansible can be from any machine with Python 2.6 installed (Windows isn't supported for the control machine).
|
||
12 years ago
|
|
||
11 years ago
|
This includes Red Hat, Debian, CentOS, OS X, any of the BSDs, and so on.
|
||
|
|
||
11 years ago
|
.. _managed_node_requirements:
|
||
11 years ago
|
|
||
11 years ago
|
Managed Node Requirements
|
||
|
`````````````````````````
|
||
11 years ago
|
|
||
11 years ago
|
On the managed nodes, you only need Python 2.4 or later, but if you are are running less than Python 2.5 on the remotes, you will also need:
|
||
13 years ago
|
|
||
13 years ago
|
* ``python-simplejson``
|
||
13 years ago
|
|
||
12 years ago
|
.. note::
|
||
|
|
||
|
Ansible's "raw" module (for executing commands in a quick and dirty
|
||
12 years ago
|
way) and the script module don't even need that. So technically, you can use
|
||
12 years ago
|
Ansible to install python-simplejson using the raw module, which
|
||
|
then allows you to use everything else. (That's jumping ahead
|
||
|
though.)
|
||
13 years ago
|
|
||
11 years ago
|
.. note::
|
||
|
|
||
|
If you have SELinux enabled on remote nodes, you will also want to install
|
||
11 years ago
|
libselinux-python on them before using any copy/file/template related functions in
|
||
11 years ago
|
Ansible. You can of course still use the yum module in Ansible to install this package on
|
||
|
remote systems that do not have it.
|
||
|
|
||
12 years ago
|
.. note::
|
||
|
|
||
|
Python 3 is a slightly different language than Python 2 and most python programs (including
|
||
11 years ago
|
Ansible) are not switching over yet. However, some Linux distributions (Gentoo, Arch) may not have a
|
||
12 years ago
|
Python 2.X interpreter installed by default. On those systems, you should install one, and set
|
||
11 years ago
|
the 'ansible_python_interpreter' variable in inventory (see :doc:`intro_inventory`) to point at your 2.X python. Distributions
|
||
12 years ago
|
like Red Hat Enterprise Linux, CentOS, Fedora, and Ubuntu all have a 2.X interpreter installed
|
||
|
by default and this does not apply to those distributions. This is also true of nearly all
|
||
|
Unix systems. If you need to bootstrap these remote systems by installing Python 2.X,
|
||
|
using the 'raw' module will be able to do it remotely.
|
||
12 years ago
|
|
||
11 years ago
|
.. _from_source:
|
||
13 years ago
|
|
||
11 years ago
|
Running From Source
|
||
|
+++++++++++++++++++
|
||
13 years ago
|
|
||
|
Ansible is trivially easy to run from a checkout, root permissions are not required
|
||
11 years ago
|
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.
|
||
|
|
||
|
To install from source.
|
||
12 years ago
|
|
||
|
.. code-block:: bash
|
||
13 years ago
|
|
||
|
$ git clone git://github.com/ansible/ansible.git
|
||
|
$ cd ./ansible
|
||
|
$ source ./hacking/env-setup
|
||
13 years ago
|
|
||
11 years ago
|
If you don't have pip installed in your version of Python, install pip::
|
||
11 years ago
|
|
||
11 years ago
|
$ sudo easy_install pip
|
||
|
|
||
|
Ansible also uses the the following Python modules that need to be installed::
|
||
|
|
||
|
$ sudo pip install paramiko PyYAML jinja2
|
||
11 years ago
|
|
||
|
Once running the env-setup script you'll be running from checkout and the default inventory file
|
||
11 years ago
|
will be /etc/ansible/hosts. You can optionally specify an inventory file (see :doc:`intro_inventory`)
|
||
11 years ago
|
other than /etc/ansible/hosts:
|
||
12 years ago
|
|
||
|
.. code-block:: bash
|
||
13 years ago
|
|
||
13 years ago
|
$ echo "127.0.0.1" > ~/ansible_hosts
|
||
13 years ago
|
$ export ANSIBLE_HOSTS=~/ansible_hosts
|
||
|
|
||
12 years ago
|
You can read more about the inventory file in later parts of the manual.
|
||
|
|
||
11 years ago
|
Now let's test things with a ping command:
|
||
12 years ago
|
|
||
|
.. code-block:: bash
|
||
13 years ago
|
|
||
|
$ ansible all -m ping --ask-pass
|
||
13 years ago
|
|
||
11 years ago
|
You can also use "sudo make install" if you wish.
|
||
13 years ago
|
|
||
11 years ago
|
.. _from_yum:
|
||
|
|
||
11 years ago
|
Latest Release Via Yum
|
||
|
++++++++++++++++++++++
|
||
12 years ago
|
|
||
11 years ago
|
RPMs are available from yum for `EPEL
|
||
12 years ago
|
<http://fedoraproject.org/wiki/EPEL>`_ 6 and currently supported
|
||
11 years ago
|
Fedora distributions.
|
||
12 years ago
|
|
||
|
Ansible itself can manage earlier operating
|
||
11 years ago
|
systems that contain python 2.4 or higher (so also EL5).
|
||
12 years ago
|
|
||
11 years ago
|
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>`_
|
||
12 years ago
|
|
||
12 years ago
|
.. code-block:: bash
|
||
13 years ago
|
|
||
|
# install the epel-release RPM if needed on CentOS, RHEL, or Scientific Linux
|
||
|
$ sudo yum install ansible
|
||
|
|
||
11 years ago
|
You can also build an RPM yourself. From the root of a checkout or tarball, use the ``make rpm`` command to build an RPM you can distribute and install. Make sure you have ``rpm-build``, ``make``, and ``python2-devel`` installed.
|
||
12 years ago
|
|
||
|
.. code-block:: bash
|
||
13 years ago
|
|
||
|
$ git clone git://github.com/ansible/ansible.git
|
||
|
$ cd ./ansible
|
||
|
$ make rpm
|
||
12 years ago
|
$ sudo rpm -Uvh ~/rpmbuild/ansible-*.noarch.rpm
|
||
13 years ago
|
|
||
11 years ago
|
.. _from_apt:
|
||
|
|
||
11 years ago
|
Latest Releases Via Apt (Ubuntu)
|
||
|
++++++++++++++++++++++++++++++++
|
||
13 years ago
|
|
||
12 years ago
|
Ubuntu builds are available `in a PPA here <https://launchpad.net/~rquillo/+archive/ansible>`_.
|
||
|
|
||
11 years ago
|
Once configured,
|
||
12 years ago
|
|
||
12 years ago
|
.. code-block:: bash
|
||
12 years ago
|
|
||
11 years ago
|
$ sudo add-apt-repository ppa:rquillo/ansible
|
||
|
$ sudo apt-get update
|
||
12 years ago
|
$ sudo apt-get install ansible
|
||
13 years ago
|
|
||
11 years ago
|
Debian/Ubuntu packages can also be built from the source checkout, run:
|
||
13 years ago
|
|
||
12 years ago
|
.. code-block:: bash
|
||
|
|
||
|
$ make debian
|
||
13 years ago
|
|
||
11 years ago
|
You may also wish to run from source to get the latest, which is covered above.
|
||
|
|
||
11 years ago
|
.. _from_pip:
|
||
|
|
||
11 years ago
|
Latest Releases Via Pip
|
||
|
+++++++++++++++++++++++
|
||
12 years ago
|
|
||
11 years ago
|
Ansible can be installed via "pip", the Python package manager. If 'pip' isn't already available in
|
||
|
your version of Python, you can get pip by::
|
||
12 years ago
|
|
||
11 years ago
|
$ sudo easy_install pip
|
||
12 years ago
|
|
||
11 years ago
|
Then install Ansible with::
|
||
12 years ago
|
|
||
11 years ago
|
$ sudo pip install ansible
|
||
13 years ago
|
|
||
11 years ago
|
Readers that use virtualenv can also install Ansible under virtualenv, though we'd recommend to not worry about it and just install Ansible globally. Do not use easy_install to install ansible directly.
|
||
13 years ago
|
|
||
11 years ago
|
.. _tagged_releases:
|
||
|
|
||
11 years ago
|
Tarballs of Tagged Releases
|
||
|
+++++++++++++++++++++++++++
|
||
13 years ago
|
|
||
11 years ago
|
Packaging Ansible or wanting to build a local package yourself, but don't want to do a git checkout? Tarballs of releases are available on the ansibleworks.com page.
|
||
13 years ago
|
|
||
12 years ago
|
* `Ansible/downloads <http://ansibleworks.com/releases>`_
|
||
12 years ago
|
|
||
|
These releases are also tagged in the git repository with the release version.
|
||
13 years ago
|
|
||
13 years ago
|
.. seealso::
|
||
|
|
||
11 years ago
|
:doc:`intro_adhoc`
|
||
13 years ago
|
Examples of basic commands
|
||
|
:doc:`playbooks`
|
||
|
Learning ansible's configuration management language
|
||
13 years ago
|
`Mailing List <http://groups.google.com/group/ansible-project>`_
|
||
|
Questions? Help? Ideas? Stop by the list on Google Groups
|
||
|
`irc.freenode.net <http://irc.freenode.net>`_
|
||
|
#ansible IRC chat channel
|
||
13 years ago
|
|