Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 17 additions & 25 deletions contextualization/conf-ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
################### Install Ansible/pip requisites #########################

- name: Debian/Ubuntu install requisites with apt
apt: name=python3-pip,wget,python3-setuptools,sshpass,openssh-client,unzip install_recommends=no
apt: name=python3-pip,wget,python3-setuptools,python3-venv,sshpass,openssh-client,unzip install_recommends=no
when: ansible_os_family == "Debian"

- name: Yum install requisites RH 7/8 or Fedora
Expand All @@ -116,26 +116,24 @@

######################################### Use pip to enable to set the version #############################################

- name: Set extra_args var
set_fact:
extra_args: ''

- name: Set extra_args var in py3.11
set_fact:
- name: Install virtualenv with pip in python 3.11+
pip:
name: virtualenv
executable: pip3
extra_args: --break-system-packages
when: ansible_python_version is version('3.11', '>=')

- name: Install virtualenv with pip
- name: Install virtualenv with pip in python 3.10-
pip:
name: virtualenv
executable: pip3
extra_args: "{{ extra_args }}"
when: ansible_python_version is version('3.11', '<')

- name: Create Ansible virtualenv
command:
cmd: python -m virtualenv --system-site-packages {{ VENV_PATH }}
creates: "{{ VENV_PATH }}"

# Version over 21 does not work with python 3.6 or older
- name: Upgrade pip in py3.6-
pip:
Expand Down Expand Up @@ -168,11 +166,10 @@
set_fact:
extra_args: --prefer-binary

- name: Install psutil
pip:
name: psutil
virtualenv: "{{ VENV_PATH }}"
extra_args: "{{ extra_args }}"
- name: Set extra_args var in py3.11
set_fact:
extra_args: --prefer-binary --break-system-packages
when: ansible_python_version is version('3.11', '>=')

- name: Install cryptography & pyOpenSSL in py3.11-
pip:
Expand All @@ -192,13 +189,16 @@
extra_args: "{{ extra_args }}"
when: ansible_python_version is version('3.11', '>=')

- name: Install pyyaml, wheel, paramiko and packaging
- name: Install common python dependencies with Pip
pip:
name:
- psutil
- wheel
- pyyaml
- paramiko>=2.9.5
- packaging
- jmespath
- scp
virtualenv: "{{ VENV_PATH }}"
extra_args: "{{ extra_args }}"

Expand Down Expand Up @@ -235,15 +235,7 @@
extra_args: "{{ extra_args }}"
when: ANSIBLE_VERSION == "latest"

#################################### Now install scp, jmespath and pywinrm with pip ##################################

- name: Install jmespath & scp with Pip
pip:
name:
- jmespath
- scp
virtualenv: "{{ VENV_PATH }}"
extra_args: "{{ extra_args }}"
#################################### Now install pywinrm with pip ##################################

- name: Install pywinrm with Pip
pip:
Expand Down
Loading