2013-09-03 06:08:00 +02:00
Accelerated Mode
2013-09-29 22:18:01 +02:00
================
2013-09-03 06:08:00 +02:00
.. versionadded :: 1.3
2014-02-28 00:06:49 +01:00
You Might Not Need This!
`` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ``
2014-02-15 20:35:26 +01:00
2014-02-28 00:06:49 +01:00
Are you running Ansible 1.5 or later? If so, you may not need accelerate mode due to a new feature called "SSH pipelining" and should read the :ref: `pipelining` section of the documentation.
2014-02-15 20:35:26 +01:00
2014-02-28 00:06:49 +01:00
For users on 1.5 and later, accelerate mode only makes sense if you are (A) are managing from an Enterprise Linux 6 or earlier host
2014-02-27 22:55:36 +01:00
and still are on paramiko, or (B) can't enable TTYs with sudo as described in the pipelining docs.
2014-02-15 20:35:26 +01:00
2014-02-28 00:06:49 +01:00
If you can use pipelining, Ansible will reduce the amount of files transferred over the wire,
making everything much more efficient, and performance will be on par with accelerate mode in nearly all cases, possibly excluding very large file transfer. Because less moving parts are involved, pipelining is better than accelerate mode for nearly all use cases.
2014-02-27 22:55:36 +01:00
2014-02-28 00:06:49 +01:00
Accelerate mode remains around in support of EL6
control machines and other constrained environments.
Accelerate Mode Details
`` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ``
2014-02-15 20:35:26 +01:00
2013-10-05 20:57:45 +02:00
While OpenSSH using the ControlPersist feature is quite fast and scalable, there is a certain small amount of overhead involved in
using SSH connections. While many people will not encounter a need, if you are running on a platform that doesn't have ControlPersist support (such as an EL6 control machine), you'll probably be even more interested in tuning options.
2013-10-03 03:59:08 +02:00
2013-10-05 19:50:53 +02:00
Accelerate mode is there to help connections work faster, but still uses SSH for initial secure key exchange. There is no
2013-10-05 20:57:45 +02:00
additional public key infrastructure to manage, and this does not require things like NTP or even DNS.
2013-10-03 03:59:08 +02:00
2013-10-05 20:57:45 +02:00
Accelerated mode can be anywhere from 2-6x faster than SSH with ControlPersist enabled, and 10x faster than paramiko.
2013-09-03 06:08:00 +02:00
Accelerated mode works by launching a temporary daemon over SSH. Once the daemon is running, Ansible will connect directly
2013-10-05 20:57:45 +02:00
to it via a socket connection. Ansible secures this communication by using a temporary AES key that is exchanged during
the SSH connection (this key is different for every host, and is also regenerated periodically).
2013-09-03 06:08:00 +02:00
2013-10-05 20:57:45 +02:00
By default, Ansible will use port 5099 for the accelerated connection, though this is configurable. Once running, the daemon will accept connections for 30 minutes, after which time it will terminate itself and need to be restarted over SSH.
2014-02-28 00:06:49 +01:00
Accelerated mode offers several improvements over the (deprecated) original fireball mode from which it was based:
2013-09-03 06:08:00 +02:00
* No bootstrapping is required, only a single line needs to be added to each play you wish to run in accelerated mode.
2013-10-05 20:57:45 +02:00
* Support for sudo commands (see below for more details and caveats) is available.
2013-11-05 00:15:11 +01:00
* There are fewer requirements. ZeroMQ is no longer required, nor are there any special packages beyond python-keyczar
* python 2.5 or higher is required.
2013-09-03 06:08:00 +02:00
In order to use accelerated mode, simply add `accelerate: true` to your play::
---
2014-02-28 20:18:44 +01:00
2013-09-03 06:08:00 +02:00
- hosts: all
accelerate: true
2014-02-28 20:18:44 +01:00
2013-09-03 06:08:00 +02:00
tasks:
2014-02-28 20:18:44 +01:00
2013-09-03 06:08:00 +02:00
- name: some task
command: echo {{ item }}
with_items:
- foo
- bar
- baz
If you wish to change the port Ansible will use for the accelerated connection, just add the `accelerated_port` option::
---
2014-02-28 20:18:44 +01:00
2013-09-03 06:08:00 +02:00
- hosts: all
accelerate: true
# default port is 5099
accelerate_port: 10000
The `accelerate_port` option can also be specified in the environment variable ACCELERATE_PORT, or in your `ansible.cfg` configuration::
[accelerate]
accelerate_port = 5099
As noted above, accelerated mode also supports running tasks via sudo, however there are two important caveats:
* You must remove requiretty from your sudoers options.
2013-10-05 20:57:45 +02:00
* Prompting for the sudo password is not yet supported, so the NOPASSWD option is required for sudo'ed commands.
2013-09-03 06:08:00 +02:00
2013-10-05 18:31:16 +02:00