bundles/php: rework bundle, fix directory permissions

This commit is contained in:
Franzi 2022-12-24 16:12:22 +01:00
parent 9a45e3c30e
commit 638363e927
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -1,58 +1,64 @@
version = node.metadata['php']['version']
version = node.metadata.get('php/version')
files = {
f'/etc/php/{version}/fpm/php-fpm.conf': {
'source': f'{version}/fpm.conf',
'content_type': 'mako',
'context': {
'num_cpus': node.metadata['vm']['cpu'],
'clear_env': node.metadata.get('php/clear_env', True),
},
'needs': {
# "all php packages"
'pkg_apt:'
},
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
},
directories['/var/lib/php/sessions'] = {
'owner': 'www-data',
'mode': None,
'after': {
'pkg_apt:',
}
}
files[f'/etc/php/{version}/fpm/php-fpm.conf'] = {
'source': f'{version}/fpm.conf',
'content_type': 'mako',
'context': {
'num_cpus': node.metadata.get('vm/cpu'),
'clear_env': node.metadata.get('php/clear_env', True),
},
f'/etc/php/{version}/fpm/php.ini': {
'source': f'{version}/php.ini',
'content_type': 'mako',
'context': {
'num_cpus': node.metadata['vm']['cpu'],
'post_max_size': node.metadata['php'].get('post_max_size', 10),
'memory_limit': node.metadata.get('php/memory_limit', 256),
},
'needs': {
# "all php packages"
'pkg_apt:'
},
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
},
'after': {
# "all php packages"
'pkg_apt:'
},
f'/etc/php/{version}/cli/php.ini': {
'source': f'{version}/php.ini',
'content_type': 'mako',
'context': {
'num_cpus': node.metadata['vm']['cpu'],
'post_max_size': node.metadata['php'].get('post_max_size', 10),
'memory_limit': node.metadata.get('php/memory_limit', 256),
},
'needs': {
# "all php packages"
'pkg_apt:'
},
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
},
}
svc_systemd = {
f'php{version}-fpm': {
'needs': {
'pkg_apt:',
f'file:/etc/php/{version}/fpm/php-fpm.conf',
f'file:/etc/php/{version}/fpm/php.ini',
},
files[f'/etc/php/{version}/fpm/php.ini'] = {
'source': f'{version}/php.ini',
'content_type': 'mako',
'context': {
'num_cpus': node.metadata.get('vm/cpu'),
'post_max_size': node.metadata.get('phppost_max_size', 10),
'memory_limit': node.metadata.get('php/memory_limit', 256),
},
'after': {
# "all php packages"
'pkg_apt:'
},
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
},
}
files[f'/etc/php/{version}/cli/php.ini'] = {
'source': f'{version}/php.ini',
'content_type': 'mako',
'context': {
'num_cpus': node.metadata.get('vm/cpu'),
'post_max_size': node.metadata.get('php/post_max_size', 10),
'memory_limit': node.metadata.get('php/memory_limit', 256),
},
'after': {
# "all php packages"
'pkg_apt:'
},
}
svc_systemd[f'php{version}-fpm'] = {
'needs': {
'pkg_apt:',
f'file:/etc/php/{version}/fpm/php-fpm.conf',
f'file:/etc/php/{version}/fpm/php.ini',
},
}