Changeset - b7de8e615ffd
[Not reviewed]
1 6 0
Branko Majic (branko) - 4 years ago 2020-05-05 22:59:06
branko@majic.rs
MAR-152: Drop support for Debian 8 Jessie from the wsgi_website role.
7 files changed with 3 insertions and 40 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -1895,13 +1895,12 @@ Parameters
 

	
 
Distribution compatibility
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
Role is compatible with the following distributions:
 

	
 
- Debian 8 (Jessie)
 
- Debian 9 (Stretch)
 

	
 

	
 
Examples
 
~~~~~~~~
 

	
roles/wsgi_website/defaults/main.yml
Show inline comments
 
@@ -20,7 +20,6 @@ wsgi_requirements: []
 

	
 
# Internal parameters.
 
admin: "admin-{{ fqdn | replace('.', '_') }}"
 
user: "web-{{ fqdn | replace('.', '_') }}"
 
home: "/var/www/{{ fqdn }}"
 
python_interpreter: "/usr/bin/python{{ python_version }}"
 
no_setuptools: "{% if ansible_distribution_release == 'jessie' %}{% elif ansible_distribution_release == 'stretch' %}--no-setuptools{% endif %}"
roles/wsgi_website/molecule/default/molecule.yml
Show inline comments
 
@@ -11,22 +11,12 @@ lint:
 
  name: yamllint
 
  options:
 
    config-file: ../../.yamllint.yml
 

	
 
platforms:
 

	
 
  - name: wsgi-website-jessie64
 
    groups:
 
      - wsgi-website
 
      - parameters-mandatory
 
      - parameters-optional
 
      - jessie
 
    box: debian/contrib-jessie64
 
    memory: 512
 
    cpus: 1
 

	
 
  - name: wsgi-website-stretch64
 
    groups:
 
      - wsgi-website
 
      - parameters-mandatory
 
      - parameters-optional
 
      - stretch
roles/wsgi_website/molecule/default/playbook.yml
Show inline comments
 
@@ -35,14 +35,13 @@
 
        MY_ENV_VAR: "My environment variable"
 
      futures_version: 3.1.0
 
      gunicorn_version: 19.7.0
 
      https_tls_certificate: "{{ lookup('file', 'tests/data/x509/parameters-optional.local_https.cert.pem') }}"
 
      https_tls_key: "{{ lookup('file', 'tests/data/x509/parameters-optional.local_https.key.pem') }}"
 
      packages:
 
        - "{% if ansible_distribution_release == 'jessie' %}libmariadb-client-lgpl-dev-compat\
 
{% elif ansible_distribution_release == 'stretch' %}libmariadbclient-dev-compat{% endif %}"
 
        - "libmariadbclient-dev-compat"
 
        - global
 
      proxy_headers:
 
        Accept-Encoding: '""'
 
      rewrites:
 
        - '^/rewrite1/(.*) /rewritten1/ last'
 
        - '^/rewrite2/(.*) /rewritten2/$1 last'
roles/wsgi_website/molecule/default/tests/test_parameters_optional.py
Show inline comments
 
@@ -9,20 +9,13 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
 

	
 
def test_installed_packages(host):
 
    """
 
    Tests if additional packages are installed.
 
    """
 

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

	
 
    if ansible_facts['ansible_distribution_release'] == 'jessie':
 
        mariadb_compat_package = 'libmariadb-client-lgpl-dev-compat'
 
    elif ansible_facts['ansible_distribution_release'] == 'stretch':
 
        mariadb_compat_package = 'libmariadbclient-dev-compat'
 

	
 
    assert host.package(mariadb_compat_package).is_installed
 
    assert host.package('libmariadbclient-dev-compat').is_installed
 
    assert host.package('global').is_installed
 

	
 

	
 
def test_https_enforcement(host):
 
    """
 
    Tests if HTTPS is (not) being enforced.
roles/wsgi_website/molecule/default/tests/test_parameters_optional_jessie.py
Show inline comments
 
deleted file
roles/wsgi_website/tasks/main.yml
Show inline comments
 
@@ -113,13 +113,13 @@
 
    group: "{{ user }}"
 
    mode: 02750
 

	
 
# setuptools is excluded on Stretch, because it would pull-in the
 
# pkg-resources package that then messes with pip freeze etc.
 
- name: Create Python virtual environment
 
  command: '/usr/bin/virtualenv {{ no_setuptools }} --python "{{ python_interpreter }}" --prompt "({{ fqdn }})" "{{ home }}/virtualenv"'
 
  command: '/usr/bin/virtualenv --no-setuptools --python "{{ python_interpreter }}" --prompt "({{ fqdn }})" "{{ home }}/virtualenv"'
 
  args:
 
    creates: "{{ home }}/virtualenv/bin/{{ python_interpreter | basename }}"
 
  become: true
 
  become_user: "{{ admin }}"
 
  tags:
 
    # [ANSIBLE0012] Commands should not change things if nothing needs doing
0 comments (0 inline, 0 general)