ansible-anaconda
ansible-anaconda copied to clipboard
Removing curl is not enough to remove libcurl.a
Your role triggers an error at second run here because removing curl package does not remove libcurl.a file (first run install conda, uninstall curl conda package, let libcurl.a, then second run fails because libcurl.a is still here, so curl conda package uninstall is triggered again and fail because this package is not installed).
Removing libcurl may be a better choice (and also remove curl).
Error at second run:
TASK [andrewrothstein.anaconda : update conda pkgs...] ************************************************************************************************************************************************************
changed: [jupyter.lxc]
TASK [andrewrothstein.anaconda : remove conda-curl since it conflicts with the system curl] ***********************************************************************************************************************
fatal: [jupyter.lxc]: FAILED! => {"changed": true, "cmd": ["/usr/local/anaconda/bin/conda", "remove", "-y", "curl"], "delta": "0:00:01.138967", "end": "2018-02-03 16:01:53.361129", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-02-03 16:01:52.222162", "stderr": "\nPackagesNotFoundError: The following packages are missing from the target environment:\n - curl", "stderr_lines": ["", "PackagesNotFoundError: The following packages are missing from the target environment:", " - curl"], "stdout": "Solving environment: ...working... failed", "stdout_lines": ["Solving environment: ...working... failed"]}
to retry, use: --limit @/home/lalmeras/git/log/jupyter.retry
this part about conda-curl is so janky. I wonder why the Continuum folks haven't fixed it.
I just installed the role on my desktop. Ran it multiple times without issue. I see the removal of the conda package and the corresponding removal of libconda.a. Subsequent runs register this task as "ok".
Can you explain to me how you see /usr/local/anaconda/bin/libcurl.a present after removing the conda-curl Anaconda package?
+1 Same error as above. I do not have /usr/local/anaconda/bin/libcurl.a after running. New at ansible, so not sure what other information I can provide to be helpful.
fatal: [localhost]: FAILED! => {
"changed": true,
"cmd": [
"/usr/local/anaconda/bin/conda",
"remove",
"-y",
"curl"
],
"delta": "0:00:00.990368",
"end": "2018-02-05 23:17:30.008441",
"invocation": {
"module_args": {
"_raw_params": "/usr/local/anaconda/bin/conda remove -y curl",
"_uses_shell": false,
"chdir": null,
"creates": null,
"executable": null,
"removes": "/usr/local/anaconda/lib/libcurl.a",
"stdin": null,
"warn": true
}
},
"msg": "non-zero return code",
"rc": 1,
"start": "2018-02-05 23:17:29.018073",
"stderr": "\nPackagesNotFoundError: The following packages are missing from the target environment:\n - curl",
"stderr_lines": [
"",
"PackagesNotFoundError: The following packages are missing from the target environment:",
" - curl"
],
"stdout": "Solving environment: ...working... failed",
"stdout_lines": [
"Solving environment: ...working... failed"
]
}
On my side, libcurl.a is from libcurl
package, and removing curl
package do not remove libcurl
, hence my bug. Do you have a libcurl package on your side ? Is it removed ?
@jelinekb if you manually remove libcurl package (/usr/local/anaconda/bin/conda remove -y libcurl
), next ansible run should be ok.
yea I ran into the same issue. Have to remove curl and libcurl then the playbook is less angry
What version of Anaconda are you using? I use docker to test my roles on fresh installations and for the latest with Python 3 removing the curl module does the deed. It looks like the curl package depends on the libcurl package. Are you subsequently adding a package that has a libcurl dependency? Really wish there was a conda Ansible module to idempotently ensure both the curl and libcurl packages are absent.
Hello, I m using the role with ansible 2.9.7 on vagrant with ubuntu/bionic64.
It also fails at this tasks but because module distutils.spawn
is missing:
The full traceback is:
Traceback (most recent call last):
File "/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py", line 102, in <module>
_ansiballz_main()
File "/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible.modules.conda', init_globals=None, run_name='__main__', alter_sys=True)
File "/usr/lib/python3.6/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/ansible_conda_payload_6sq8n7a6/ansible_conda_payload.zip/ansible/modules/conda.py", line 73, in <module>
ModuleNotFoundError: No module named 'distutils.spawn'
fatal: [localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py\", line 102, in <module>\n _ansiballz_main()\n File \"/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.conda', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib/python3.6/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.6/runpy.py\", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File \"/usr/lib/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_conda_payload_6sq8n7a6/ansible_conda_payload.zip/ansible/modules/conda.py\", line 73, in <module>\nModuleNotFoundError: No module named 'distutils.spawn'\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}