---
-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}}'
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
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
PYTHON36_VERSION: '{{ python36_version }}'
PYTHON37_VERSION: '{{ python37_version }}'
PYTHON38_VERSION: '{{ python38_version }}'
+ PYTHON39_VERSION: '{{ python39_version }}'
block:
- name: 'Install pyenv {{ pyenv_version }}'
git:
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