Skip to content

Commit

Permalink
Fix several venvs
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Nov 21, 2024
1 parent 070be22 commit f4a4d43
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 63 deletions.
17 changes: 1 addition & 16 deletions roles/icat_database_checker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,10 @@
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"


- name: Check if icat-database-checker virtual environment is running Python 3.6
ansible.builtin.stat:
path: '/var/lib/irods/icat-database-checker/bin/pip3.6'
register: idbc_venv_python36


# For upgrade to Yoda 1.9
- name: Move old icat-database-checker virtual environment
become_user: '{{ irods_service_account }}'
become: true
ansible.builtin.command: # noqa no-changed-when
cmd: "mv /var/lib/irods/icat-database-checker /var/lib/irods/icat-database-checker.backup-py3.6"
when: idbc_venv_python36.stat.exists


- name: Ensure iCAT database checker virtualenv exists
become_user: '{{ irods_service_account }}'
become: true
ansible.builtin.command: "{{ icat_database_checker_python3_path }} -m virtualenv /var/lib/irods/icat-database-checker"
ansible.builtin.command: "{{ icat_database_checker_python3_path }} -m venv /var/lib/irods/icat-database-checker"
args:
creates: /var/lib/irods/icat-database-checker

Expand Down
4 changes: 2 additions & 2 deletions roles/irods_arb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
state: '{{ "present" if irods_arb_enabled else "absent" }}'


- name: Ensure psutil is installed (Python 3)
- name: Ensure psutil is installed
become_user: '{{ irods_service_account }}'
become: true
ansible.builtin.pip:
name: "psutil==5.9.5"
executable: "{{ irods_arb_pip3_location }}"
extra_args: --user
extra_args: --user --break-system-packages
17 changes: 1 addition & 16 deletions roles/irods_consistency_check/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,10 @@
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"


- name: Check if ichk virtual environment is running Python 3.6
ansible.builtin.stat:
path: '/var/lib/irods/irods-consistency-check/bin/pip3.6'
register: ichk_venv_python36


# For upgrade to Yoda 1.9
- name: Move old ichk virtual environment
become_user: '{{ irods_service_account }}'
become: true
ansible.builtin.command: # noqa no-changed-when
cmd: "mv /var/lib/irods/irods-consistency-check /var/lib/irods/irods-consistency-check.backup-py3.6"
when: ichk_venv_python36.stat.exists


- name: Ensure iRODS consistency check virtualenv exists
become_user: '{{ irods_service_account }}'
become: true
ansible.builtin.command: "{{ irods_consistency_check_python3_path }} -m virtualenv /var/lib/irods/irods-consistency-check"
ansible.builtin.command: "{{ irods_consistency_check_python3_path }} -m venv /var/lib/irods/irods-consistency-check"
args:
creates: /var/lib/irods/irods-consistency-check

Expand Down
8 changes: 4 additions & 4 deletions roles/irods_icat/tasks/setup_pam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
when: enable_tokens and ansible_os_family == 'Debian' and '1.0.4' in pysqlcipher3_version.stdout


#- name: Ensure custom build of pysqlcipher3 is installed globally for token authentication script
# ansible.builtin.command: # noqa no-changed-when
# cmd: python3 -m easy_install https://github.com/UtrechtUniversity/pysqlcipher3/releases/download/v1.2.1/pysqlcipher3-1.2.1-py2.7-linux-x86_64.egg
# when: enable_tokens and ansible_os_family == 'Debian' and '1.2.1' not in pysqlcipher3_version.stdout
# - name: Ensure custom build of pysqlcipher3 is installed globally for token authentication script
# ansible.builtin.command: # noqa no-changed-when
# cmd: python3 -m easy_install https://github.com/UtrechtUniversity/pysqlcipher3/releases/download/v1.2.1/pysqlcipher3-1.2.1-py2.7-linux-x86_64.egg
# when: enable_tokens and ansible_os_family == 'Debian' and '1.2.1' not in pysqlcipher3_version.stdout


- name: Ensure token authentication script is present
Expand Down
4 changes: 2 additions & 2 deletions roles/yoda_external_user_service/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
- name: Ensure Yoda EUS virtualenv exists
become_user: '{{ yoda_deployment_user }}'
become: true
ansible.builtin.command: "virtualenv --python {{ yoda_external_user_service_python3_path }} /var/www/extuser/yoda-external-user-service/venv"
ansible.builtin.command: "{{ yoda_external_user_service_python3_path }} -m venv /var/www/extuser/yoda-external-user-service/venv"
args:
creates: "/var/www/extuser/yoda-external-user-service/venv"

Expand All @@ -210,7 +210,7 @@
become: true
ansible.builtin.pip:
name:
- pip==23.0.1
- pip==24.3.1
executable: /var/www/extuser/yoda-external-user-service/venv/bin/pip3
when: not ansible_check_mode

Expand Down
23 changes: 2 additions & 21 deletions roles/yoda_moai/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,10 @@
register: repochanges


- name: Check if MOAI virtual environment is running Python 2.7
ansible.builtin.stat:
path: '/var/www/moai/yoda-moai/venv/bin/pip2.7'
register: moai_venv_python27


- name: Check if MOAI virtual environment is running Python 3.6
ansible.builtin.stat:
path: '/var/www/moai/yoda-moai/venv/bin/pip3.6'
register: moai_venv_python36


# For upgrade to Yoda 1.9
- name: Move old MOAI virtual environment
ansible.builtin.command: # noqa no-changed-when
cmd: "mv /var/www/moai/yoda-moai/venv /var/www/moai/venv.backup-pre-1.9"
when: moai_venv_python27.stat.exists or moai_venv_python36.stat.exists


- name: Ensure Yoda MOAI virtualenv exists
become_user: '{{ yoda_moai_user }}'
become: true
ansible.builtin.command: "virtualenv --python {{ yoda_moai_python3_path }} {{ yoda_moai_home }}/yoda-moai/venv"
ansible.builtin.command: "{{ yoda_moai_python3_path }} -m venv {{ yoda_moai_home }}/yoda-moai/venv"
args:
creates: "{{ yoda_moai_home }}/yoda-moai/venv"

Expand All @@ -79,7 +60,7 @@
become: true
ansible.builtin.pip:
name:
- pip==23.0.1
- pip==24.3.1
executable: /var/www/moai/yoda-moai/venv/bin/pip3


Expand Down
4 changes: 2 additions & 2 deletions roles/yoda_web_mock/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
- name: Ensure Yoda web mock virtualenv exists
become_user: '{{ yoda_deployment_user }}'
become: true
ansible.builtin.command: "virtualenv --python {{ yoda_web_mock_python3_path }} /var/www/webmock/venv"
ansible.builtin.command: "{{ yoda_web_mock_python3_path }} -m venv /var/www/webmock/venv"
args:
creates: "/var/www/webmock/venv"

Expand All @@ -45,7 +45,7 @@
become: true
ansible.builtin.pip:
name:
- pip==23.0.1
- pip==24.3.1
executable: /var/www/webmock/venv/bin/pip3
when: not ansible_check_mode

Expand Down

0 comments on commit f4a4d43

Please sign in to comment.