Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if Ansible pipelining is enabled / working

Ansible has the ability to work faster when pipelining is enabled. However there are some requirements to make this work. Pipelinging must be enabled in ansible.cfg or in the inventory-file and requiretty must be dissabled.

I already checked -vvvv, nothing showed up concering 'pipelining'. Also, I do not notice any difference in speed.

Because of all this I would like to know if: is there a way to verify Ansible is using the pipelining ability?

like image 781
Thomas Detemmerman Avatar asked Apr 16 '17 14:04

Thomas Detemmerman


People also ask

How do I enable Ansible pipeline?

Pipelining can be enabled globally by setting “pipelining=True” in the ssh section of ansible. cfg, or setting “ANSIBLE_SSH_PIPELINING=1” in the environment. With Ansible 2 (not yet released), you can also set ansible_ssh_pipelining in the inventory or in a playbook. You can leave it enabled in ansible.

What is Ansible pipelining?

Pipelining is the modern Ansible method of speeding up your ssh connections across the network to the managed hosts. It replaces the former Accelerated Mode. It reduces the number of ssh operations required to execute a module by executing many Ansible modules without an actual file transfer.

What is host key checking in Ansible?

Ansible enables host key checking by default. Checking host keys guards against server spoofing and man-in-the-middle attacks, but it does require some maintenance. If a host is reinstalled and has a different key in 'known_hosts', this will result in an error message until corrected.

Where can I find Ansible CFG?

The default Ansible configuration file is located under /etc/ansible/ansible. cfg . Most of Ansible's settings can be modified using this configuration file to meet the needs of your environment, but the default configurations should satisfy most use cases.


1 Answers

To check if pipelining is in use, call: ansible test-server -vvv -m shell -a 'echo ok'.

If you see only one SSH: EXEC ssh record with something like /bin/sh -c '/usr/bin/python && sleep 0', then pipelining is in use.

If you see three to five SSH: EXEC ssh/SSH: EXEC sftp/PUT records, executing command.py from tmp path, then pipelining mode is not active.

like image 191
Konstantin Suvorov Avatar answered Oct 23 '22 09:10

Konstantin Suvorov