Skip to content

Commit d526011

Browse files
authored
Add Ansible SSH pipelining option (#66)
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
1 parent 4f2145c commit d526011

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Asm/Ansible/Command/AnsiblePlaybook.php

+16
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,22 @@ public function hostKeyChecking(bool $enable = true): AnsiblePlaybookInterface
716716
$this->processBuilder->setEnv('ANSIBLE_HOST_KEY_CHECKING', $flag);
717717
return $this;
718718
}
719+
720+
/**
721+
* Ansible SSH pipelining option
722+
* https://docs.ansible.com/ansible/latest/reference_appendices/config.html#ansible-pipelining
723+
*
724+
* @param bool $enable
725+
**/
726+
public function sshPipelining(bool $enable = false): AnsiblePlaybookInterface
727+
{
728+
$enable ?
729+
$flag = 'True' :
730+
$flag = 'False';
731+
732+
$this->processBuilder->setEnv('ANSIBLE_SSH_PIPELINING', $flag);
733+
return $this;
734+
}
719735

720736
/**
721737
* If no inventory file is given, assume

0 commit comments

Comments
 (0)