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

Ensure that miniconda_tmp_dir exists fails to set mode with default /tmp value #33

Open
HarryWeppner opened this issue Feb 28, 2024 · 2 comments

Comments

@HarryWeppner
Copy link
Contributor

@andrewrothstein, when attempting to use the newly published role v6.3.0, the added check that the miniconda_tmp_dir exists fails as it can't change the mode on the default /tmp directory.

TASK [andrewrothstein.miniconda : Ensure that /tmp directory exists] ********************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: PermissionError: [Errno 1] Operation not permitted: b'/tmp'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/harryweppner/.ansible/tmp/ansible-tmp-1709145014.3165748-87070-269424488826438/AnsiballZ_file.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/harryweppner/.ansible/tmp/ansible-tmp-1709145014.3165748-87070-269424488826438/AnsiballZ_file.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/harryweppner/.ansible/tmp/ansible-tmp-1709145014.3165748-87070-269424488826438/AnsiballZ_file.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.file', init_globals=dict(_module_fqn='ansible.modules.file', _modlib_path=modlib_path),\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_ansible.builtin.file_payload_rfzrg7bx/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 987, in <module>\n  File \"/tmp/ansible_ansible.builtin.file_payload_rfzrg7bx/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 973, in main\n  File \"/tmp/ansible_ansible.builtin.file_payload_rfzrg7bx/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 680, in ensure_directory\n  File \"/tmp/ansible_ansible.builtin.file_payload_rfzrg7bx/ansible_ansible.builtin.file_payload.zip/ansible/module_utils/basic.py\", line 1159, in set_fs_attributes_if_different\n  File \"/tmp/ansible_ansible.builtin.file_payload_rfzrg7bx/ansible_ansible.builtin.file_payload.zip/ansible/module_utils/basic.py\", line 919, in set_mode_if_different\nPermissionError: [Errno 1] Operation not permitted: b'/tmp'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
@HarryWeppner
Copy link
Contributor Author

I am working around this by using another directory as the miniconda_tmp_dir.

@bromeara
Copy link

I also ran into this error, I tried resolving it by adding the become: {{escalate_ansible}} to the task but that changed the permissions of the /tmp directory for me from 777 to 744 which broke a lot of other things on the system.

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