From: Eric Ball Date: Tue, 23 Feb 2021 03:23:58 +0000 (-0800) Subject: Add Python 3.9, update all py versions X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=a1d52d651d7ed61e2554b7de9e382ef996ef24cc;p=ansible%2Froles%2Fpython-install.git Add Python 3.9, update all py versions This also includes changes to molecule/default/prepare.yml and tox.ini that are required for compatibility with the latest version of molecule. Issue: IT-21563 Change-Id: I02820c1648b7a0c67b02b6b7d6cbbe171c52ee82 Signed-off-by: Eric Ball --- diff --git a/defaults/main.yml b/defaults/main.yml index 8f4e000..3ab76ca 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,9 +1,10 @@ --- -pyenv_version: v1.2.17 +pyenv_version: v1.2.23 python34_version: 3.4.10 -python35_version: 3.5.8 -python36_version: 3.6.10 -python37_version: 3.7.7 -python38_version: 3.8.2 +python35_version: 3.5.10 +python36_version: 3.6.13 +python37_version: 3.7.10 +python38_version: 3.8.7 +python39_version: 3.9.1 pyenv_command: 'pyenv global system {{python38_version}} {{python37_version}} {{python36_version}} {{python35_version}} {{python34_version}}' diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index a80cccc..5ee898a 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -3,9 +3,14 @@ hosts: all gather_facts: true tasks: + - rpm_key: + state: present + key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8 + when: ansible_os_family == 'RedHat' + become: true - name: Install Fedora EPEL repo yum: - name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm state: present when: ansible_os_family == 'RedHat' become: true diff --git a/tasks/main.yml b/tasks/main.yml index d09ebf7..b0a9450 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,11 +16,11 @@ block: - name: On Ubuntu >= 18.04 set_fact: - pyenv_command: 'pyenv global system {{ python38_version }} {{ python37_version }} {{ python36_version }} {{ python35_version }}' + pyenv_command: 'pyenv global system {{ python39_version }} {{ python38_version }} {{ python37_version }} {{ python36_version }} {{ python35_version }}' when: ansible_distribution_version >= '18.04' - name: On CentOS >= 8 set_fact: - pyenv_command: 'pyenv global {{ python38_version }} {{ python37_version }} {{ python36_version }} {{ python35_version }}' + pyenv_command: 'pyenv global {{ python39_version }} {{ python38_version }} {{ python37_version }} {{ python36_version }} {{ python35_version }}' when: ansible_distribution == 'CentOS' and ansible_distribution_major_version >= '8' - name: Install Python via pyenv @@ -32,6 +32,7 @@ PYTHON36_VERSION: '{{ python36_version }}' PYTHON37_VERSION: '{{ python37_version }}' PYTHON38_VERSION: '{{ python38_version }}' + PYTHON39_VERSION: '{{ python39_version }}' block: - name: 'Install pyenv {{ pyenv_version }}' git: @@ -49,6 +50,8 @@ command: pyenv install -s "$PYTHON37_VERSION" - name: 'Install Python {{ python38_version }}' command: pyenv install -s "$PYTHON38_VERSION" + - name: 'Install Python {{ python39_version }}' + command: pyenv install -s "$PYTHON39_VERSION" - name: Set pyenv global command: '{{ pyenv_command }}' become: true diff --git a/tox.ini b/tox.ini index a0f2e9b..76423c7 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ deps = ansible~=2.9.6 ansible-lint~=4.2.0 docker - molecule + molecule[docker] pytest passenv = * commands =