Changeset - c0e6117effbd
[Not reviewed]
0 6 0
Branko Majic (branko) - 2 years ago 2023-12-01 16:24:14
branko@majic.rs
MAR-189: Added support for Debian 11 Bullseye to web_server role.
6 files changed with 39 insertions and 1 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -1491,12 +1491,13 @@ Parameters
 
Distribution compatibility
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
Role is compatible with the following distributions:
 

	
 
- Debian 10 (Buster)
 
- Debian 11 (Bullseye)
 

	
 

	
 
Examples
 
~~~~~~~~
 

	
 
Here is an example configuration for setting-up web server:
roles/web_server/defaults/main.yml
Show inline comments
 
@@ -13,13 +13,15 @@ ECDHE-RSA-AES256-GCM-SHA384:\
 
ECDHE-RSA-CHACHA20-POLY1305:\
 
!aNULL:!MD5:!EXPORT"
 

	
 
# Internal parameters
 
php_fpm_service_name_per_release:
 
  buster: "php7.3-fpm"
 
  bullseye: "php7.4-fpm"
 

	
 
php_base_config_dir_per_release:
 
  buster: "/etc/php/7.3"
 
  bullseye: "/etc/php/7.4"
 

	
 
php_fpm_package_name: "php-fpm"
 
php_fpm_service_name: "{{ php_fpm_service_name_per_release[ansible_distribution_release] }}"
 
php_base_config_dir: "{{ php_base_config_dir_per_release[ansible_distribution_release] }}"
roles/web_server/meta/main.yml
Show inline comments
 
@@ -9,6 +9,7 @@ galaxy_info:
 
  license: BSD
 
  min_ansible_version: 2.9
 
  platforms:
 
    - name: Debian
 
      versions:
 
        - 10
 
        - 11
roles/web_server/molecule/default/molecule.yml
Show inline comments
 
@@ -12,13 +12,13 @@ lint:
 
  options:
 
    config-file: ../../.yamllint.yml
 

	
 
platforms:
 

	
 
  - name: client
 
    box: debian/contrib-buster64
 
    box: debian/bullseye64
 
    memory: 256
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.11
 
        network_name: private_network
 
@@ -47,12 +47,38 @@ platforms:
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.22
 
        network_name: private_network
 
        type: static
 

	
 
  - name: parameters-mandatory-bullseye
 
    groups:
 
      - parameters-mandatory
 
      - bullseye
 
    box: debian/bullseye64
 
    memory: 512
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.31
 
        network_name: private_network
 
        type: static
 

	
 
  - name: parameters-optional-bullseye
 
    groups:
 
      - parameters-optional
 
      - bullseye
 
    box: debian/bullseye64
 
    memory: 512
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.32
 
        network_name: private_network
 
        type: static
 

	
 
provisioner:
 
  name: ansible
 
  playbooks:
 
    cleanup: cleanup.yml
 
  config_options:
 
    defaults:
roles/web_server/molecule/default/prepare.yml
Show inline comments
 
@@ -24,12 +24,16 @@
 
          - "{{ item.fqdn }}"
 
      with_items:
 
        - name: parameters-mandatory-buster_https
 
          fqdn: parameters-mandatory-buster
 
        - name: parameters-optional-buster_https
 
          fqdn: parameters-optional-buster
 
        - name: parameters-mandatory-bullseye_https
 
          fqdn: parameters-mandatory-bullseye
 
        - name: parameters-optional-bullseye_https
 
          fqdn: parameters-optional-bullseye
 

	
 
    - name: Set-up link to generated X.509 material
 
      file:
 
        src: ".gimmecert"
 
        dest: "tests/data/x509"
 
        state: link
 
@@ -73,12 +77,14 @@
 
        mode: 0644
 
        state: present
 
      with_dict:
 
        192.168.56.11: "client"
 
        192.168.56.21: "parameters-mandatory-buster"
 
        192.168.56.22: "parameters-optional-buster"
 
        192.168.56.31: "parameters-mandatory-bullseye"
 
        192.168.56.32: "parameters-optional-bullseye"
 

	
 
    - name: Install curl for testing redirects and webpage content
 
      apt:
 
        name: curl
 
        state: present
 

	
roles/web_server/molecule/default/tests/conftest.py
Show inline comments
 
@@ -26,10 +26,12 @@ def php_info(host):
 

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

	
 
    if ansible_distribution_release == 'buster':
 
        info = PHPInfo(fpm_package='php-fpm', fpm_service='php7.3-fpm', base_config_dir='/etc/php/7.3')
 
    elif ansible_distribution_release == 'bullseye':
 
        info = PHPInfo(fpm_package='php-fpm', fpm_service='php7.4-fpm', base_config_dir='/etc/php/7.4')
 
    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)