Files
@ 3d1e72c4cbaf
Branch filter:
Location: majic-ansible-roles/roles/php_website/molecule/default/tests/conftest.py - annotation
3d1e72c4cbaf
1.4 KiB
text/x-python
MAR-192: Drop rsyslog/logrotate configuration for ldap_server role under Debian 12 Bookworm:
- Default installations of Debian 12 Bookworm no longer come with
rsyslog pre-installed (and it is considered to be deprecated as
default system logger under Debian 12 Bookworm).
- Default installations of Debian 12 Bookworm no longer come with
rsyslog pre-installed (and it is considered to be deprecated as
default system logger under Debian 12 Bookworm).
161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 9e06b8437eeb 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 161187c252c0 9e06b8437eeb 9e06b8437eeb 161187c252c0 161187c252c0 161187c252c0 161187c252c0 | from collections import namedtuple
import pytest
@pytest.fixture
def php_info(host):
"""
Helper fixture used to define what the expected PHP-FPM 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:
- fpm_package (name of the PHP-FPM package)
- fpm_service (name of the PHP-FPM system service)
- fpm_pool_dir (pato to directory with PHP-FPM pool definitions)
- base_config_dir (base configuration directory for PHP)
"""
PHPInfo = namedtuple('PHPInfo', 'fpm_package fpm_service fpm_pool_dir base_config_dir')
ansible_facts = host.ansible("setup")["ansible_facts"]
ansible_distribution_release = ansible_facts['ansible_distribution_release']
if ansible_distribution_release == 'bullseye':
info = PHPInfo(fpm_package='php-fpm', fpm_service='php7.4-fpm', fpm_pool_dir='/etc/php/7.4/fpm/pool.d', base_config_dir='/etc/php/7.4')
elif ansible_distribution_release == 'bookworm':
info = PHPInfo(fpm_package='php-fpm', fpm_service='php8.2-fpm', fpm_pool_dir='/etc/php/8.2/fpm/pool.d', base_config_dir='/etc/php/8.2')
else:
raise Exception('The php_info pytest fixture does not support Debian release: %s' % ansible_distribution_release)
return info
|