If i run following command in the ubuntu terminal it gets excecuted with no errors:
/opt/miniconda3/bin/conda update conda -y
But when i try the same command with Ansible on my localhost(so the same ubuntu) i get a big error. Ansible code:
- name: conda - update
become: True
shell: /opt/miniconda3/bin/conda update conda -y
args:
executable: /bin/bash
I also tried it without the arguments but i get the same error. Does someone know how to fix that error or another way to update (mini)conda with Ansible?
The error is the following:
TASK [conda : conda - update] *********************************************************************************************************************************************** fatal: [localhost]: FAILED! => {"changed": true, "cmd": "/opt/miniconda3/bin/conda update conda -y", "delta": "0:01:23.130438", "end": "2022-04-27 01:20:14.709342", "msg": "non-zero return code", "rc": 1, "start": "2022-04-27 01:18:51.578904", "stderr": "\rca-certificates-2022 | 129 KB | | 0% \rca-certificates-2022 | 129 KB | 9 | 9% \rca-certificates-2022 | 129 KB | ########## | 100% \n\rsetuptools-61.2.0 | 1.3 MB | | 0% \rsetuptools-61.2.0 | 1.3 MB | | 1% \rsetuptools-61.2.0 | 1.3 MB | ####5 | 46% \rsetuptools-61.2.0 | 1.3 MB | #######9 | 80% \rsetuptools-61.2.0 | 1.3 MB | #########4 | 94% \rsetuptools-61.2.0 | 1.3 MB | ########## | 100% \n\rconda-package-handli | 954 KB | | 0% \rconda-package-handli | 954 KB | 1 | 1% \rconda-package-handli | 954 KB | #1 | 11% \rconda-package-handli | 954 KB | ##3 | 24% \rconda-package-handli | 954 KB | ###9 | 39% \rconda-package-handli | 954 KB | #####9 | 59% \rconda-package-handli | 954 KB | #######8 | 79% \rconda-package-handli | 954 KB | #########2 | 92% \rconda-package-handli | 954 KB | ########## | 100% \n\rurllib3-1.26.9 | 176 KB | | 0% \rurllib3-1.26.9 | 176 KB | 6 | 7% \rurllib3-1.26.9 | 176 KB | ########## | 100% \nERROR conda.core.link:_execute(502): An error occurred while installing package 'defaults::charset-normalizer-2.0.4-pyhd3eb1b0_0'.\nAssertionError()\nAttempting to roll back.\n\n\nAssertionError()\nAssertionError()", "stderr_lines": ["", "ca-certificates-2022 | 129 KB | | 0% ", "ca-certificates-2022 | 129 KB | 9 | 9% ", "ca-certificates-2022 | 129 KB | ########## | 100% ", "", "setuptools-61.2.0 | 1.3 MB | | 0% ", "setuptools-61.2.0 | 1.3 MB | | 1% ", "setuptools-61.2.0 | 1.3 MB | ####5 | 46% ", "setuptools-61.2.0 | 1.3 MB | #######9 | 80% ", "setuptools-61.2.0 | 1.3 MB | #########4 | 94% ", "setuptools-61.2.0 | 1.3 MB | ########## | 100% ", "", "conda-package-handli | 954 KB | | 0% ", "conda-package-handli | 954 KB | 1 | 1% ", "conda-package-handli | 954 KB | #1 | 11% ", "conda-package-handli | 954 KB | ##3 | 24% ", "conda-package-handli | 954 KB | ###9 | 39% ", "conda-package-handli | 954 KB | #####9 | 59% ", "conda-package-handli | 954 KB | #######8 | 79% ", "conda-package-handli | 954 KB | #########2 | 92% ", "conda-package-handli | 954 KB | ########## | 100% ", "", "urllib3-1.26.9 | 176 KB | | 0% ", "urllib3-1.26.9 | 176 KB | 6 | 7% ", "urllib3-1.26.9 | 176 KB | ########## | 100% ", "ERROR conda.core.link:_execute(502): An error occurred while installing package 'defaults::charset-normalizer-2.0.4-pyhd3eb1b0_0'.", "AssertionError()", "Attempting to roll back.", "", "", "AssertionError()", "AssertionError()"], "stdout": "Solving environment: ...working... done\n\n## Package Plan ##\n\n environment location: /opt/miniconda3\n\n added / updated specs: \n - conda\n\n\nThe following packages will be downloaded:\n\n package | build\n ---------------------------|-----------------\n ca-certificates-2022.3.29 | h06a4308_1 129 KB\n setuptools-61.2.0 | py37h06a4308_0 1.3 MB\n conda-package-handling-1.8.1| py37h7f8727e_0 954 KB\n urllib3-1.26.9 | py37h06a4308_0 176 KB\n ------------------------------------------------------------\n Total: 2.5 MB\n\nThe following packages will be UPDATED:\n\n asn1crypto: 0.24.0-py36_0 --> 1.4.0-py_0 \n brotlipy: 0.7.0-py39h27cfd23_1003 --> 0.7.0-py37h27cfd23_1003 \n ca-certificates: 2018.03.07-0 --> 2022.3.29-h06a4308_1 \n certifi: 2018.4.16-py36_0 --> 2021.10.8-py37h06a4308_2\n cffi: 1.11.5-py36h9745a5d_0 --> 1.15.0-py37h7f8727e_0 \n chardet: 3.0.4-py36h0f667ec_1 --> 4.0.0-py37h06a4308_1003 \n charset-normalizer: 2.0.4-pyhd3eb1b0_0 --> 2.0.4-pyhd3eb1b0_0 \n colorama: 0.4.4-pyhd3eb1b0_0 --> 0.4.4-pyhd3eb1b0_0 \n conda: 4.5.4-py36_0 --> 4.12.0-py37h06a4308_0 \n conda-package-handling: 1.8.0-py39h7f8727e_0 --> 1.8.1-py37h7f8727e_0 \n cryptography: 2.2.2-py36h14c3975_0 --> 36.0.0-py37h9ce1e76_0 \n idna: 2.6-py36h82fb2a8_1 --> 3.3-pyhd3eb1b0_0 \n libgcc-ng: 7.2.0-hdf63c60_3 --> 9.1.0-hdf63c60_0 \n libstdcxx-ng: 7.2.0-hdf63c60_3 --> 9.1.0-hdf63c60_0 \n openssl: 1.0.2o-h20670df_0 --> 1.1.1n-h7f8727e_0 \n pip: 10.0.1-py36_0 --> 21.2.2-py37h06a4308_0 \n pycosat: 0.6.3-py36h0a5515d_0 --> 0.6.3-py37h27cfd23_0 \n pycparser: 2.18-py36hf9f622e_1 --> 2.21-pyhd3eb1b0_0 \n pyopenssl: 18.0.0-py36_0 --> 22.0.0-pyhd3eb1b0_0 \n pysocks: 1.6.8-py36_0 --> 1.7.1-py37_1 \n python: 3.6.5-hc3d631a_2 --> 3.7.2-h0371630_0 \n requests: 2.18.4-py36he2e5f8d_1 --> 2.27.1-pyhd3eb1b0_0 \n ruamel_yaml: 0.15.37-py36h14c3975_2 --> 0.15.87-py37h7b6447c_0 \n setuptools: 39.2.0-py36_0 --> 61.2.0-py37h06a4308_0 \n six: 1.11.0-py36h372c433_1 --> 1.16.0-pyhd3eb1b0_1 \n sqlite: 3.23.1-he433501_0 --> 3.26.0-h7b6447c_0 \n tk: 8.6.7-hc745277_3 --> 8.6.11-h1ccaba5_0 \n tqdm: 4.63.0-pyhd3eb1b0_0 --> 4.63.0-pyhd3eb1b0_0 \n urllib3: 1.22-py36hbe7ace6_0 --> 1.26.9-py37h06a4308_0 \n wheel: 0.31.1-py36_0 --> 0.37.1-pyhd3eb1b0_0 \n\n\nDownloading and Extracting Packages\nPreparing transaction: ...working... done\nVerifying transaction: ...working... done\nExecuting transaction: ...working... failed\nRolling back transaction: ...working... done", "stdout_lines": ["Solving environment: ...working... done", "", "## Package Plan ##", "", " environment location: /opt/miniconda3", "", " added / updated specs: ", " - conda", "", "", "The following packages will be downloaded:", "", " package | build", " ---------------------------|-----------------", " ca-certificates-2022.3.29 | h06a4308_1 129 KB", " setuptools-61.2.0 | py37h06a4308_0 1.3 MB", " conda-package-handling-1.8.1| py37h7f8727e_0 954 KB", " urllib3-1.26.9 | py37h06a4308_0 176 KB", " ------------------------------------------------------------", " Total: 2.5 MB", "", "The following packages will be UPDATED:", "", " asn1crypto: 0.24.0-py36_0 --> 1.4.0-py_0 ", " brotlipy: 0.7.0-py39h27cfd23_1003 --> 0.7.0-py37h27cfd23_1003 ", " ca-certificates: 2018.03.07-0 --> 2022.3.29-h06a4308_1 ", " certifi: 2018.4.16-py36_0 --> 2021.10.8-py37h06a4308_2", " cffi: 1.11.5-py36h9745a5d_0 --> 1.15.0-py37h7f8727e_0 ", " chardet: 3.0.4-py36h0f667ec_1 --> 4.0.0-py37h06a4308_1003 ", " charset-normalizer: 2.0.4-pyhd3eb1b0_0 --> 2.0.4-pyhd3eb1b0_0 ", " colorama: 0.4.4-pyhd3eb1b0_0 --> 0.4.4-pyhd3eb1b0_0 ", " conda: 4.5.4-py36_0 --> 4.12.0-py37h06a4308_0 ", " conda-package-handling: 1.8.0-py39h7f8727e_0 --> 1.8.1-py37h7f8727e_0 ", " cryptography: 2.2.2-py36h14c3975_0 --> 36.0.0-py37h9ce1e76_0 ", " idna: 2.6-py36h82fb2a8_1 --> 3.3-pyhd3eb1b0_0 ", " libgcc-ng: 7.2.0-hdf63c60_3 --> 9.1.0-hdf63c60_0 ", " libstdcxx-ng: 7.2.0-hdf63c60_3 --> 9.1.0-hdf63c60_0 ", " openssl: 1.0.2o-h20670df_0 --> 1.1.1n-h7f8727e_0 ", " pip: 10.0.1-py36_0 --> 21.2.2-py37h06a4308_0 ", " pycosat: 0.6.3-py36h0a5515d_0 --> 0.6.3-py37h27cfd23_0 ", " pycparser: 2.18-py36hf9f622e_1 --> 2.21-pyhd3eb1b0_0 ", " pyopenssl: 18.0.0-py36_0 --> 22.0.0-pyhd3eb1b0_0 ", " pysocks: 1.6.8-py36_0 --> 1.7.1-py37_1 ", " python: 3.6.5-hc3d631a_2 --> 3.7.2-h0371630_0 ", " requests: 2.18.4-py36he2e5f8d_1 --> 2.27.1-pyhd3eb1b0_0 ", " ruamel_yaml: 0.15.37-py36h14c3975_2 --> 0.15.87-py37h7b6447c_0 ", " setuptools: 39.2.0-py36_0 --> 61.2.0-py37h06a4308_0 ", " six: 1.11.0-py36h372c433_1 --> 1.16.0-pyhd3eb1b0_1 ", " sqlite: 3.23.1-he433501_0 --> 3.26.0-h7b6447c_0 ", " tk: 8.6.7-hc745277_3 --> 8.6.11-h1ccaba5_0 ", " tqdm: 4.63.0-pyhd3eb1b0_0 --> 4.63.0-pyhd3eb1b0_0 ", " urllib3: 1.22-py36hbe7ace6_0 --> 1.26.9-py37h06a4308_0 ", " wheel: 0.31.1-py36_0 --> 0.37.1-pyhd3eb1b0_0 ", "", "", "Downloading and Extracting Packages", "Preparing transaction: ...working... done", "Verifying transaction: ...working... done", "Executing transaction: ...working... failed", "Rolling back transaction: ...working... done"]}