You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sap_swpm: inifile generation on non-linux ansible controllers
Error:
TASK [community.sap_install.sap_swpm : SAP SWPM Pre Install - Create temporary directory on control node] *********
fatal: [test-nwas -> localhost]: FAILED! => changed=false
module_stderr: |-
sudo: a password is required
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1
Analysis:
This is caused by delegate_to: localhost and hardcoding user and group parameters of built-in Ansible Modules tempfile/copy/template; setting parameter mode has no apparent effect. When removed or become: false is set - then the processing occurs on the remote/target host then the file is correctly generated and execution occurs.
To retain this, would require execution from macOS (and likely Windows WSL when the playbook file is on Windows NTFS drive instead of inside the Linux container) with sudo and env var passing: sudo -E ansible-playbook test.yml
It is also very possible this will cause issues in pipeline containers where storage is restrictive, such as Azure DevOps Pipeline, Jenkins, CircleCI, TravisCI, OpenShift Pipelines (Tekton), GitLab Runner etc.
The benefit of processing the inifile locally (between 10-100 seconds, assuming 1 sec processing per parameter and maximum 100 inifile parameters) is a minor benefit when compared to the cross-platform interoperability benefit.
Suggestion:
To retain local processing, declare become: false and remove user + group parameters for built-in Ansible Modules tempfile/copy/template.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this @sean-freeman. I tried several combinations of parameters for tempfile, copy and template, and the one which passed all my tests was the one without localhost delegation for the affected tasks. So let's got that route then.
berndfinger
added a commit
to berndfinger/community.sap_install
that referenced
this issue
Nov 20, 2024
sap_swpm: inifile generation on non-linux ansible controllers
Error:
Analysis:
This is caused by
delegate_to: localhost
and hardcodinguser
andgroup
parameters of built-in Ansible Modulestempfile/copy/template
; setting parametermode
has no apparent effect. When removed orbecome: false
is set - then the processing occurs on the remote/target host then the file is correctly generated and execution occurs.To retain this, would require execution from macOS (and likely Windows WSL when the playbook file is on Windows NTFS drive instead of inside the Linux container) with sudo and env var passing:
sudo -E ansible-playbook test.yml
It is also very possible this will cause issues in pipeline containers where storage is restrictive, such as Azure DevOps Pipeline, Jenkins, CircleCI, TravisCI, OpenShift Pipelines (Tekton), GitLab Runner etc.
The benefit of processing the inifile locally (between 10-100 seconds, assuming 1 sec processing per parameter and maximum 100 inifile parameters) is a minor benefit when compared to the cross-platform interoperability benefit.
Suggestion:
To retain local processing, declare
become: false
and removeuser
+group
parameters for built-in Ansible Modulestempfile/copy/template
.The text was updated successfully, but these errors were encountered: