From 32845500748724861b94b34496ca418ccc39b9d7 Mon Sep 17 00:00:00 2001 From: rajeshP524 Date: Tue, 29 Mar 2022 19:35:22 +0530 Subject: [PATCH] Fix Browbeat installation with OSP17 on RHEL9 Browbeat installation is failing on OSP17 on RHEL9 because, 'python3-virtualenv' package is removed in RHEL9. So usage of 'virtualenv' for creating rally,browbeat,shaker virtual environments fails the browbeat installation. This patch fixes that issue. Change-Id: Iaa2d9c2ad0601197d1671219d9a63033c89622a2 --- ansible/install/roles/browbeat/tasks/main.yml | 14 +++++++++++++- ansible/install/roles/rally/tasks/main.yml | 5 +++++ ansible/install/roles/shaker/tasks/main.yml | 5 +++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ansible/install/roles/browbeat/tasks/main.yml b/ansible/install/roles/browbeat/tasks/main.yml index 18ddc0469..a3fa3731d 100644 --- a/ansible/install/roles/browbeat/tasks/main.yml +++ b/ansible/install/roles/browbeat/tasks/main.yml @@ -24,7 +24,7 @@ when: ansible_distribution_major_version < '8' ignore_errors: yes -- name: Install dependencies for RHEL8 +- name: Install dependencies for RHEL8 and RHEL9 yum: name: - gcc @@ -36,6 +36,13 @@ - python3-policycoreutils - python3-devel - python3-pip + state: present + become: true + when: ansible_distribution_major_version >= '8' + +- name: Install dependency virtualenv for RHEL8 + yum: + name: - python3-virtualenv state: present become: true @@ -98,6 +105,11 @@ - name: Create browbeat virtualenv command: virtualenv {{ browbeat_venv }} creates={{ browbeat_venv }} + when: ansible_distribution_major_version <= '8' + +- name: Create browbeat virtualenv + command: python3 -m venv {{ browbeat_venv }} creates={{ browbeat_venv }} + when: ansible_distribution_major_version == '9' - name: Setup browbeat-venv CA certificate path lineinfile: diff --git a/ansible/install/roles/rally/tasks/main.yml b/ansible/install/roles/rally/tasks/main.yml index 9ca432623..0448ec9cd 100644 --- a/ansible/install/roles/rally/tasks/main.yml +++ b/ansible/install/roles/rally/tasks/main.yml @@ -5,6 +5,11 @@ - name: Create rally virtualenv command: virtualenv --python=python3 {{ rally_venv }} creates={{ rally_venv }} + when: ansible_distribution_major_version <= '8' + +- name: Create rally virtualenv + command: python3 -m venv {{ rally_venv }} creates={{ rally_venv }} + when: ansible_distribution_major_version == '9' - name: Rally Add browbeat to Python path shell: echo 'export PYTHONPATH=$PYTHONPATH:{{ browbeat_path }}' >> {{ rally_venv }}/bin/activate diff --git a/ansible/install/roles/shaker/tasks/main.yml b/ansible/install/roles/shaker/tasks/main.yml index 29fa6d4b7..bb4af83da 100644 --- a/ansible/install/roles/shaker/tasks/main.yml +++ b/ansible/install/roles/shaker/tasks/main.yml @@ -5,6 +5,11 @@ - name: Create shaker virtualenv command: virtualenv {{ shaker_venv }} creates={{ shaker_venv }} + when: ansible_distribution_major_version <= '8' + +- name: Create shaker virtualenv + command: python3 -m venv {{ shaker_venv }} creates={{ shaker_venv }} + when: ansible_distribution_major_version == '9' - name: Setup shaker-venv CA certificate path lineinfile: