Files
@ cc53faac4b27
Branch filter:
Location: majic-ansible-roles/roles/web_server/molecule/default/tests/conftest.py - annotation
cc53faac4b27
1.2 KiB
text/x-python
MAR-189: Shift the IP addresses around a bit in the mail_server role tests.
a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f 34dffc4a5ea3 34dffc4a5ea3 34dffc4a5ea3 a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f 951070e5575b 34dffc4a5ea3 c0e6117effbd c0e6117effbd a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f | from collections import namedtuple
import pytest
@pytest.fixture
def php_info(host):
"""
Helper fixture used to define what the expected PHP-FPM package
name, PHP-FPM service name, and PHP base configuration directory
is based on Debian release.
Currently supports:
- Debian 10 (Buster)
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)
- base_config_dir (base configuration directory for PHP)
"""
PHPInfo = namedtuple('PHPInfo', 'fpm_package fpm_service base_config_dir')
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
|