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

RPM download code can fail with a permission error #591

Open
kkeane opened this issue Dec 24, 2024 · 1 comment
Open

RPM download code can fail with a permission error #591

kkeane opened this issue Dec 24, 2024 · 1 comment
Assignees
Labels
bug question Further information is requested

Comments

@kkeane
Copy link

kkeane commented Dec 24, 2024

Under certain circumstances, the task TASK [crowdstrike.falcon.falcon_install : CrowdStrike Falcon | Copy Sensor Installation Package to remote host (non-windows)] ***

Can produce the following error:

The error was: PermissionError: [Errno 1] Operation not permitted: b'/tmp/falcon-sensor/falcon-sensor-7.20.0-17306.el8.x86_64.rpm'

The circumstances when the first issue happens are:

  • The user name on the ansible controller is different from the ansible user on the host.
  • Ansible is targetting the controller itself.

The problem has to do with the delegate: local attribute.

In my example, the ansible controller runs as user ansiblectl, while remote_user is set to svc-ansible.

In this case, the following appears to happen:

Expected outcome:

  • the file /tmp/falcon-sensor/falcon-sensor-7.20.0-17306.el8.x86_64.rpm is created with permissions 640 and owned by svc-ansible. The RPM will be installed and Ansible complete without an error.

Actual outcome (when targeting the ansible controller)

  • the file /tmp/falcon-sensor/falcon-sensor-7.20.0-17306.el8.x86_64.rpm is created with permissions 640 and owned by ansiblectl. The RPM is not readable for user svc-ansible.

The underlying problem seems to be that the RPM is downloaded with delegate: local as user ansiblectl, but used as remote_user: svc-ansible. The change of ownership is supposed to happen in the copy module, but when targeting the ansible controller, this operation is skipped.

@carlosmmatos
Copy link
Contributor

@kkeane - Thanks for opening up the issue. I will look into this soon.

@carlosmmatos carlosmmatos added question Further information is requested bug labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants