Skip to content

Commit

Permalink
Cleanup Yoda portal role
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Nov 21, 2024
1 parent 0167aa4 commit a995692
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
21 changes: 3 additions & 18 deletions roles/yoda_portal/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,10 @@
register: portalchanges


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


# For upgrade to Yoda 1.9
- name: Move old portal virtual environment
become_user: '{{ yoda_deployment_user }}'
become: true
ansible.builtin.command: # noqa no-changed-when
cmd: "mv /var/www/yoda/venv /var/www/yoda/venv.backup-pre-1.9"
when: portal_venv_python36.stat.exists


- name: Ensure Yoda portal virtualenv exists
become_user: "{{ yoda_deployment_user }}"
become: true
ansible.builtin.command: "virtualenv --python {{ yoda_portal_python3_path }} /var/www/yoda/venv"
ansible.builtin.command: "{{ yoda_portal_python3_path }} -m venv /var/www/yoda/venv"
args:
creates: /var/www/yoda/venv

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


Expand All @@ -68,7 +53,7 @@
ansible.builtin.pip:
requirements: /var/www/yoda/requirements.txt
virtualenv: '/var/www/yoda/venv'
virtualenv_python: python3.8
virtualenv_python: python3.12
environment:
C_INCLUDE_PATH: "{{ yoda_portal_python3_include_path }}"
notify: Restart Apache webserver
Expand Down
2 changes: 1 addition & 1 deletion roles/yoda_portal/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ openssl_private_dir: '/etc/ssl/private/'
openssl_certs_dir: '/etc/ssl/certs'

yoda_portal_python3_path: /usr/bin/python3
yoda_portal_python3_include_path: /usr/include/python3.8
yoda_portal_python3_include_path: /usr/include/python3.12
yoda_portal_site_config_dir: /etc/apache2/sites-available
yoda_portal_site_enabled_config_dir: /etc/apache2/sites-enabled
yoda_portal_site_config_file: 001-yoda-portal-vhost.conf
Expand Down

0 comments on commit a995692

Please sign in to comment.