# Copyright © 2020 Interplanetary Database Association e.V., # Planetmint and IPDB software contributors. # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 --- - name: Check if python3 already installed shell: which python3 register: chk_py39 ignore_errors: yes tags: [py39] - name: Check version of python3 shell: "python3 -c 'import platform; print(platform.python_version())' | cut -d. -f-2" when: chk_py39.rc == 0 register: py39_ver tags: [py39] - name: Creating files for python 3.9 installation file: template: src=install_py39.j2 dest=/home/vagrant/install_py39.bash mode: 0755 when: chk_py39.rc == 0 and (py39_ver.stdout | float < 3.9) tags: [py39] - name: Install py39 shell: "bash /home/vagrant/install_py39.bash > install_py39.txt" register: install_py39 failed_when: "'FAILED' in install_py39.stderr or install_py39.rc != 0" when: chk_py39.rc == 0 and (py39_ver.stdout | float < 3.9) tags: [py39]