diff --git a/ansible_install.yaml b/ansible_install.yaml index 7b5d3d13d..64186eadc 100644 --- a/ansible_install.yaml +++ b/ansible_install.yaml @@ -25,20 +25,10 @@ - name: Set transport to ssh in ansible.cfg ini_file: dest=/etc/ansible/ansible.cfg section=defaults option=transport value=ssh - when: ansible_os_family == "Debian" or (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 6) or (ansible_os_family == "Suse" and ansible_distribution_major_version|int >= 10) - - name: Set transport to smart in ansible.cfg - ini_file: dest=/etc/ansible/ansible.cfg section=defaults option=transport value=smart - when: (ansible_os_family == "RedHat" and ansible_distribution_major_version|int < 6) or (ansible_os_family == "Suse" and ansible_distribution_major_version|int < 10) - - name: Change ssh_args to set ControlPersist to 15 min in ansible.cfg ini_file: dest=/etc/ansible/ansible.cfg section=ssh_connection option=ssh_args value="-o ControlMaster=auto -o ControlPersist=900s" - when: ansible_os_family == "Debian" or (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7) or (ansible_os_family == "Suse" and ansible_distribution_major_version|int >= 12) - - - name: Change ssh_args to remove ControlPersist in REL 6 and older in ansible.cfg - ini_file: dest=/etc/ansible/ansible.cfg section=ssh_connection option=ssh_args value="" - when: (ansible_os_family == "RedHat" and ansible_distribution_major_version|int < 7) or (ansible_os_family == "Suse" and ansible_distribution_major_version|int < 12) - + - name: Activate SSH pipelining in ansible.cfg ini_file: dest=/etc/ansible/ansible.cfg section=ssh_connection option=pipelining value=True @@ -49,16 +39,12 @@ when: ansible_os_family == "Debian" - name: Apt install requirements Ubuntu/Debian - apt: name=gcc,python-dev,python-pysqlite2,openssh-client,sshpass,libssl-dev,libffi-dev + apt: name=gcc,python3-dev,openssh-client,sshpass,libssl-dev,libffi-dev when: ansible_os_family == "Debian" - name: Debian/Ubuntu install python-pip with apt - apt: name=python-pip install_recommends=no - when: ansible_os_family == "Debian" and not (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 20) - - - name: Install pip in in Ubuntu 20+ - shell: wget https://bootstrap.pypa.io/get-pip.py && python2 get-pip.py warn=false creates=/usr/local/bin/pip2 chdir=/tmp - when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 20 + apt: name=python3-pip install_recommends=no + when: ansible_os_family == "Debian" - name: Apt install requirements Debian apt: name=default-libmysqlclient-dev @@ -77,28 +63,45 @@ when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int < 20 - name: Yum install requirements RH - yum: name=python-pip,python-distribute,gcc,python-devel,wget,openssh-clients,sshpass,libffi-devel,openssl-devel,mysql-devel,sqlite-devel + yum: name=python3-pip,gcc,python3-devel,wget,openssh-clients,sshpass,libffi-devel,openssl-devel,mysql-devel when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora" - name: Yum install requirements Fedora - yum: name=python-pip,redhat-rpm-config,gcc,python-devel,wget,openssh-clients,sshpass,libffi-devel,openssl-devel,mysql-devel,sqlite-devel + yum: name=python3-pip,redhat-rpm-config,gcc,python3-devel,wget,openssh-clients,sshpass,libffi-devel,openssl-devel,mysql-devel when: ansible_distribution == "Fedora" - - name: Install last pip version + # Version over 21 does not work with python 3.5 or older + - name: Upgrade pip in py3.5 + pip: + name: pip>18.0,<21.0 + executable: pip3 + when: ansible_python_version is version('3.6', '<') + + - name: Upgrade pip in py3.6 + pip: - name: pip>=9.0.3 - executable: pip + name: pip>18.0 + executable: pip3 + when: ansible_python_version is version('3.6', '>=') - name: Install setuptools with pip - pip: executable=pip name=setuptools,six extra_args="-I" + pip: executable=pip3 name=setuptools,six extra_args="-I" + + - name: Install cryptography + pip: + name: cryptography<3.3 + executable: pip3 + + - name: Install pyOpenSSL + pip: + name: pyOpenSSL>20.0 + executable: pip3 - name: Install pip libraries - pip: executable=pip name=pycrypto,pyOpenSSL,mysqlclient,msrest,msrestazure,azure-common,azure-mgmt-storage,azure-mgmt-compute,azure-mgmt-network,azure-mgmt-resource,azure-mgmt-dns,xmltodict - - - name: Install IM dependencies for CentOS 6 - pip: name=pysqlite version=2.7.0 - when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "6" + pip: executable=pip3 name=msrest,msrestazure,azure-common,azure-mgmt-storage,azure-mgmt-compute,azure-mgmt-network,azure-mgmt-resource,azure-mgmt-dns + + - name: Install pip libraries + pip: executable=pip3 name=mysqlclient,xmltodict,cheroot,pymongo - name: Install IM - pip: executable=pip name=IM + pip: executable=pip3 name=IM