Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap_swpm: inifile generation on non-linux ansible controllers #890

Closed
sean-freeman opened this issue Nov 20, 2024 · 2 comments
Closed

sap_swpm: inifile generation on non-linux ansible controllers #890

sean-freeman opened this issue Nov 20, 2024 · 2 comments
Assignees

Comments

@sean-freeman
Copy link
Member

sean-freeman commented Nov 20, 2024

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.

@berndfinger berndfinger self-assigned this Nov 20, 2024
@berndfinger
Copy link
Member

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
Copy link
Member

Solved in #891.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants