Skip to content

Commit b3126ef

Browse files
committed
[repo_setup] Add cifmw_repo_setup_venv var
Currently repo-setup gets installed with {{ cifmw_repo_setup_basedir }}/venv. This venv is shared with other roles. Dependencies coming from different repo causes issue with repo-setup. Currently ansible-core deps installed via ci-framework gets used in repo-setup causes following issue: ``` HTTPSConnection.__init__() got an unexpected keyword argument 'cert_file'. Failed to create HashInfo object ``` Updating ansible-core will fix the issue but it may cause issue with other ci-framework roles. In order to avoid that, we are adding a seperate var to create seperate venv to keep repo-setup dependency seperate and avoid issues. Jira: OSPRH-16694 Signed-off-by: Chandan Kumar (raukadah) <[email protected]>
1 parent ff07546 commit b3126ef

File tree

7 files changed

+11
-7
lines changed

7 files changed

+11
-7
lines changed

roles/repo_setup/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ using `cifmw_repo_setup_src` role default var.
1212

1313
## Parameters
1414
* `cifmw_repo_setup_basedir`: (String) Installation base directory. Defaults to `cifmw_basedir` which defaults to `~/ci-framework-data`.
15+
* `cifmw_repo_setup_venv: (String) repo-setup virtualenv. Defaults to `{{ cifmw_repo_setup_basedir }}/venv/repo-setup`.
1516
* `cifmw_repo_setup_promotion`: (String) Promotion line you want to deploy. Defaults to `current-podified`.
1617
* `cifmw_repo_setup_branch`: (String) Branch/release you want to deploy. Defaults to `zed`.
1718
* `cifmw_repo_setup_dlrn_uri`: (String) DLRN base URI. Defaults to `https://trunk.rdoproject.org/`.

roles/repo_setup/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# To get dlrn md5 hash for components [baremetal,cinder,clients,cloudops,common,
2121
# compute,glance,manila,network,octavia,security,swift,tempest,podified,ui,validation]
2222
cifmw_repo_setup_basedir: "{{ cifmw_basedir | default(ansible_user_dir ~ '/ci-framework-data') }}"
23+
cifmw_repo_setup_venv: "{{ cifmw_repo_setup_basedir }}/venv/repo-setup"
2324
cifmw_repo_setup_promotion: "current-podified"
2425
cifmw_repo_setup_branch: "antelope"
2526
cifmw_repo_setup_dlrn_uri: "https://trunk.rdoproject.org/"

roles/repo_setup/molecule/default/converge.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
cifmw_repo_setup_os_release: centos
2222
cifmw_repo_setup_component_name: baremetal
2323
cifmw_repo_setup_component_promotion_tag: consistent
24+
cifmw_repo_setup_venv: "{{ cifmw_repo_setup_basedir }}/venv/repo-setup_test"
2425
roles:
2526
- role: "repo_setup"
2627
tasks:
@@ -52,7 +53,7 @@
5253
path: "{{ ansible_user_dir }}/ci-framework-data/{{ item }}"
5354
loop:
5455
- 'artifacts/repositories/delorean.repo.md5'
55-
- 'venv'
56+
- 'venv/repo_setup_test'
5657
- 'artifacts/repositories'
5758
- name: Assert file status
5859
ansible.builtin.assert:

roles/repo_setup/tasks/artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- name: Run repo-setup-get-hash
33
ansible.builtin.command:
44
cmd: >-
5-
{{ cifmw_repo_setup_basedir }}/venv/bin/repo-setup-get-hash
5+
{{ cifmw_repo_setup_venv }}/bin/repo-setup-get-hash
66
--dlrn-url {{ cifmw_repo_setup_dlrn_uri[:-1] }}
77
--os-version {{ cifmw_repo_setup_os_release }}{{ cifmw_repo_setup_dist_major_version }}
88
--release {{ cifmw_repo_setup_branch }}

roles/repo_setup/tasks/cleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
- name: Remove virtualenv
1818
ansible.builtin.file:
19-
path: "{{ cifmw_repo_setup_basedir }}/venv"
19+
path: "{{ cifmw_repo_setup_venv }}"
2020
state: absent
2121

2222
- name: Remove repositories

roles/repo_setup/tasks/configure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
become: "{{ not cifmw_repo_setup_output.startswith(ansible_user_dir) }}"
1212
ansible.builtin.command:
1313
cmd: >-
14-
{{ cifmw_repo_setup_basedir }}/venv/bin/repo-setup
14+
{{ cifmw_repo_setup_venv }}/bin/repo-setup
1515
{{ cifmw_repo_setup_promotion }} {{ cifmw_repo_setup_additional_repos }}
1616
-d {{ cifmw_repo_setup_os_release }}{{ cifmw_repo_setup_dist_major_version }}
1717
-b {{ cifmw_repo_setup_branch }}

roles/repo_setup/tasks/install.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
loop:
88
- tmp
99
- artifacts/repositories
10+
- venv/repo_setup
1011

1112
- name: Make sure git-core package is installed
1213
become: true
@@ -25,12 +26,12 @@
2526

2627
- name: Initialize python venv and install requirements
2728
ansible.builtin.pip:
28-
virtualenv: "{{ cifmw_repo_setup_basedir }}/venv"
29+
virtualenv: "{{ cifmw_repo_setup_venv }}"
2930
requirements: "{{ cifmw_repo_setup_basedir }}/tmp/repo-setup/requirements.txt"
3031
virtualenv_command: "python3 -m venv --system-site-packages --upgrade-deps"
3132

3233
- name: Install repo-setup package
3334
ansible.builtin.command:
34-
cmd: "{{ cifmw_repo_setup_basedir }}/venv/bin/python setup.py install"
35+
cmd: "{{ cifmw_repo_setup_venv }}/bin/python setup.py install"
3536
chdir: "{{ cifmw_repo_setup_basedir }}/tmp/repo-setup"
36-
creates: "{{ cifmw_repo_setup_basedir }}/venv/bin/repo-setup"
37+
creates: "{{ cifmw_repo_setup_venv }}/bin/repo-setup"

0 commit comments

Comments
 (0)