Skip to content

Commit

Permalink
Add Ansible SSH pipelining option (#66)
Browse files Browse the repository at this point in the history
Pipelining, if supported by the connection plugin, reduces the number of network operations required to execute a module on the remote server, by executing many Ansible modules without actual file transfer. This can result in a very significant performance improvement when enabled. However this conflicts with privilege escalation (become). For example, when using ‘sudo:’ operations you must first disable ‘requiretty’ in /etc/sudoers on all managed hosts, which is why it is disabled by default. 

- https://docs.ansible.com/ansible/latest/reference_appendices/config.html#ansible-pipelining
  • Loading branch information
florianbeer authored May 9, 2021
1 parent 4f2145c commit d526011
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Asm/Ansible/Command/AnsiblePlaybook.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,22 @@ public function hostKeyChecking(bool $enable = true): AnsiblePlaybookInterface
$this->processBuilder->setEnv('ANSIBLE_HOST_KEY_CHECKING', $flag);
return $this;
}

/**
* Ansible SSH pipelining option
* https://docs.ansible.com/ansible/latest/reference_appendices/config.html#ansible-pipelining
*
* @param bool $enable
**/
public function sshPipelining(bool $enable = false): AnsiblePlaybookInterface
{
$enable ?
$flag = 'True' :
$flag = 'False';

$this->processBuilder->setEnv('ANSIBLE_SSH_PIPELINING', $flag);
return $this;
}

/**
* If no inventory file is given, assume
Expand Down

0 comments on commit d526011

Please sign in to comment.