Skip to content

Commit 94e5754

Browse files
committed
Remove pipelining from ansible.cfg
Pipelining is an Ansible optimization that sends the Python module script over the existing SSH connection instead of creating a temporary file on the remote host. Disabling it could make Ansible slightly slower but should henance the robustness avoiding -13 SIGPIPE error. Add ansible_common_remote_group: sapsys to tasks that become a non root user.
1 parent 584546f commit 94e5754

5 files changed

Lines changed: 8 additions & 10 deletions

File tree

ansible.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
[ssh_connection]
2-
pipelining = True
32
ssh_args = -C -o ControlMaster=auto -o ControlPersist=86400s

ansible/playbooks/roles/sap_hana_install/tasks/post_install/hdbuserstore.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22

33
- name: SAP HANA Post Install - Create and Store Connection Info in hdbuserstore
4+
vars:
5+
ansible_pipelining: true
46
ansible.builtin.shell: |
57
/usr/sap/{{ sap_hana_install_sid }}/SYS/exe/hdb/hdbuserstore \
68
SET {{ sap_hana_install_hdbuserstore_key }} \

scripts/qesap/lib/cmds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def ansible_command_sequence(
312312
# 1. Create the environment variable set
313313
# that will be used by any command
314314
original_env = dict(os.environ)
315-
original_env["ANSIBLE_PIPELINING"] = "True"
315+
original_env["ANSIBLE_PIPELINING"] = "False"
316316
ansible_callbacks = []
317317
if profile:
318318
ansible_callbacks.append("ansible.posix.profile_tasks")

scripts/qesap/test/conftest.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,6 @@ def _callback(inventory):
219219
def mock_call_ansibleplaybook():
220220
"""
221221
create a mock.call with some default elements
222-
```
223-
mock.call('ansible-playbook -i inventory, playbook', env={'ANSIBLE_PIPELINING', 'True'})
224-
```
225222
"""
226223

227224
def _callback(inventory, playbook, verbosity="-vv", arguments=None, env=None):
@@ -230,7 +227,7 @@ def _callback(inventory, playbook, verbosity="-vv", arguments=None, env=None):
230227
playbook_cmd += arguments
231228
if env is None:
232229
original_env = dict(os.environ)
233-
original_env["ANSIBLE_PIPELINING"] = "True"
230+
original_env["ANSIBLE_PIPELINING"] = "False"
234231
else:
235232
original_env = env
236233
return mock.call(cmd=' '.join(playbook_cmd), env=original_env)

scripts/qesap/test/unit/test_qesap_ansible.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ def test_ansible_env_config(
623623
# Keep it here just to be more explicit and due to the fact that here
624624
# the os.environ is mock.
625625
expected_env = {"MELAMPO": "cane"}
626-
expected_env["ANSIBLE_PIPELINING"] = "True"
626+
expected_env["ANSIBLE_PIPELINING"] = "False"
627627
for playbook in playbook_files_list:
628628
calls.append(mock_call_ansibleplaybook(inventory, playbook, env=expected_env))
629629

@@ -668,7 +668,7 @@ def test_ansible_profile(
668668
playbook_files_list = create_playbooks(playbooks["create"])
669669
calls = []
670670
expected_env = {"MELAMPO": "cane"}
671-
expected_env["ANSIBLE_PIPELINING"] = "True"
671+
expected_env["ANSIBLE_PIPELINING"] = "False"
672672
expected_env["ANSIBLE_CALLBACKS_ENABLED"] = "ansible.posix.profile_tasks"
673673
for playbook in playbook_files_list:
674674
calls.append(mock_call_ansibleplaybook(inventory, playbook, env=expected_env))
@@ -717,7 +717,7 @@ def test_ansible_junit(
717717
playbook_files_list = create_playbooks(playbooks["create"])
718718
calls = []
719719
expected_env = {"MELAMPO": "cane"}
720-
expected_env["ANSIBLE_PIPELINING"] = "True"
720+
expected_env["ANSIBLE_PIPELINING"] = "False"
721721
expected_env["ANSIBLE_CALLBACKS_ENABLED"] = "junit"
722722
expected_env["JUNIT_OUTPUT_DIR"] = "/something/somewhere"
723723
for playbook in playbook_files_list:
@@ -772,7 +772,7 @@ def test_ansible_env_roles_path(
772772
playbook_files_list = create_playbooks(["get_cherry_wood"])
773773
calls = []
774774
expected_env = dict(os.environ)
775-
expected_env["ANSIBLE_PIPELINING"] = "True"
775+
expected_env["ANSIBLE_PIPELINING"] = "False"
776776
expected_env["ANSIBLE_ROLES_PATH"] = "somewhere"
777777
for playbook in playbook_files_list:
778778
calls.append(mock_call_ansibleplaybook(inventory, playbook, env=expected_env))

0 commit comments

Comments
 (0)