Changeset - 09e9aaa170b3
[Not reviewed]
0 3 0
Branko Majic (branko) - 20 days ago 2024-08-30 23:03:22
branko@majic.rs
MAR-239: Dropped support for Debian 11 Bullseye from the wsgi_website role.
3 files changed with 2 insertions and 16 deletions:
0 comments (0 inline, 0 general)
roles/wsgi_website/defaults/main.yml
Show inline comments
 
---
 

	
 
additional_nginx_config: {}
 
packages: []
 
rewrites: []
 
static_locations: []
 
use_paste: false
 
virtualenv_packages: []
 
environment_variables: {}
 
website_mail_recipients: "root"
 
environment_indicator: null
 
http_header_overrides: {}
 
wsgi_requirements:
 
  - gunicorn==21.2.0
 
  - packaging==23.2
 
wsgi_requirements_in:
 
  - gunicorn
 

	
 
# Internal parameters.
 
admin: "admin-{{ fqdn | replace('.', '_') }}"
 
user: "web-{{ fqdn | replace('.', '_') }}"
 
home: "/var/www/{{ fqdn }}"
 
python_interpreter: "/usr/bin/python3"
 
pip_check_requirements_upgrades_directory: "/etc/pip_check_requirements_upgrades"
 
virtualenv_prompt: "{% if ansible_distribution_release == 'bullseye' %}({{ fqdn }}) {% else %}{{ fqdn }}{% endif %}"
 
virtualenv_prompt: "{{ fqdn }}"
roles/wsgi_website/molecule/default/molecule.yml
Show inline comments
 
---
 

	
 
dependency: {}
 

	
 
driver:
 
  name: vagrant
 
  provider:
 
    name: virtualbox
 

	
 
lint:
 
  name: yamllint
 
  options:
 
    config-file: ../../.yamllint.yml
 

	
 
platforms:
 

	
 
  - name: wsgi-website-bullseye
 
    groups:
 
      - wsgi-website
 
      - parameters-mandatory
 
      - parameters-optional
 
    box: debian/bullseye64
 
    memory: 512
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 

	
 
  - name: wsgi-website-bookworm
 
    groups:
 
      - wsgi-website
 
      - parameters-mandatory
 
      - parameters-optional
 
    box: debian/bookworm64
 
    memory: 512
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 

	
 
provisioner:
 
  name: ansible
 
  playbooks:
 
    cleanup: cleanup.yml
 
  config_options:
 
    defaults:
 
      force_valid_group_names: "ignore"
 
      interpreter_python: "/usr/bin/python3"
 
    ssh_connection:
 
      pipelining: "True"
 
  lint:
 
    name: ansible-lint
 

	
 
scenario:
 
  name: default
 

	
 
verifier:
 
  name: testinfra
 
  lint:
 
    name: flake8
roles/wsgi_website/molecule/default/tests/conftest.py
Show inline comments
 
from collections import namedtuple
 

	
 
import pytest
 

	
 

	
 
@pytest.fixture
 
def python_info(host):
 
    """
 
    Helper fixture used to define what the expected Python details
 
    are (paths, package names etc) based on Debian release.
 

	
 
    Currently supports:
 

	
 
    - Debian 11 (Bullseye)
 
    - Debian 12 (Bookworm)
 

	
 
    Resulting information can be accessed through returned named tuple
 
    with the following properties:
 

	
 
    - python_version (version of installed Python interpreter)
 
    """
 

	
 
    PythonInfo = namedtuple('PythonInfo', 'python_version')
 

	
 
    ansible_facts = host.ansible("setup")["ansible_facts"]
 
    ansible_distribution_release = ansible_facts['ansible_distribution_release']
 

	
 
    if ansible_distribution_release == 'bullseye':
 
        info = PythonInfo(python_version="3.9.2")
 
    elif ansible_distribution_release == 'bookworm':
 
    if ansible_distribution_release == 'bookworm':
 
        info = PythonInfo(python_version="3.11.2")
 
    else:
 
        raise Exception('The php_info pytest fixture does not support Debian release: %s' % ansible_distribution_release)
 

	
 
    return info
0 comments (0 inline, 0 general)