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

Cleanup Handler is failing if sdkman_user is 'root' #66

Open
martin-huber opened this issue Apr 14, 2022 · 0 comments
Open

Cleanup Handler is failing if sdkman_user is 'root' #66

martin-huber opened this issue Apr 14, 2022 · 0 comments

Comments

@martin-huber
Copy link

martin-huber commented Apr 14, 2022

the main-handler currently is:

- name: Cleanup SDKMAN script
  file:
    path: '{{ sdkman_tmp_dir }}/sdkman_script'
    state: absent

and fails, if sdkman_user is 'root', because the sdkman_script then is owned by 'root' but attempted to be deleted by the ansible user.

It should be

- name: Cleanup SDKMAN script
  file:
    path: '{{ sdkman_tmp_dir }}/sdkman_script'
    state: absent
  become: '{{ sdkman_user != ansible_user_id }}'
  become_user: '{{ sdkman_user }}'

Using ansible-sdkman 1.7.0 with ansible [core 2.11.9]

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

1 participant