diff --git a/contextualization/conf-ansible.yml b/contextualization/conf-ansible.yml index d07659a6..de3172eb 100644 --- a/contextualization/conf-ansible.yml +++ b/contextualization/conf-ansible.yml @@ -7,10 +7,6 @@ # Ansible specific Version or "latest" ANSIBLE_VERSION: 4.10.0 tasks: - - name: Set Ansible version from env if defined - set_fact: ANSIBLE_VERSION={{ lookup('env','ANSIBLE_VERSION') }} - when: lookup('env','ANSIBLE_VERSION') != "" - ############## To avoid some issues with cloud-init and unattended upgrades ############### - name: Avoid unattended upgrades raw: | @@ -168,8 +164,9 @@ - name: Install cryptography & pyOpenSSL in py3.11+ pip: - name: cryptography>36.0.0 - name: pyOpenSSL>20.0 + name: + - cryptography>36.0.0 + - pyOpenSSL>20.0 executable: pip3 extra_args: "{{ extra_args }}" when: ansible_python_version is version('3.11', '>=') @@ -184,12 +181,21 @@ executable: pip3 extra_args: "{{ extra_args }}" - - name: Set Ansible newer version for python 3.12 + - name: Set Ansible newer version for python 3.8+ + set_fact: + ANSIBLE_VERSION: 6.7.0 + when: + - ansible_python_version is version('3.8', '>=') + + - name: Set Ansible newer version for python 3.9+ set_fact: ANSIBLE_VERSION: 8.7.0 when: - - ansible_python_version is version('3.12', '>=') - - ANSIBLE_VERSION is version('8.7.0', '<') + - ansible_python_version is version('3.9', '>=') + + - name: Set Ansible version from env if defined + set_fact: ANSIBLE_VERSION={{ lookup('env','ANSIBLE_VERSION') }} + when: lookup('env','ANSIBLE_VERSION') != "" - name: Install ansible {{ ANSIBLE_VERSION }} with Pip pip: