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 = { directories['/var/lib/php/sessions'] = {
f'/etc/php/{version}/fpm/php-fpm.conf': { 'owner': 'www-data',
'source': f'{version}/fpm.conf', 'mode': None,
'content_type': 'mako', 'after': {
'context': { 'pkg_apt:',
'num_cpus': node.metadata['vm']['cpu'], }
'clear_env': node.metadata.get('php/clear_env', True), }
},
'needs': { files[f'/etc/php/{version}/fpm/php-fpm.conf'] = {
# "all php packages" 'source': f'{version}/fpm.conf',
'pkg_apt:' 'content_type': 'mako',
}, 'context': {
'triggers': { 'num_cpus': node.metadata.get('vm/cpu'),
f'svc_systemd:php{version}-fpm:restart', 'clear_env': node.metadata.get('php/clear_env', True),
},
}, },
f'/etc/php/{version}/fpm/php.ini': { 'after': {
'source': f'{version}/php.ini', # "all php packages"
'content_type': 'mako', 'pkg_apt:'
'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',
},
}, },
f'/etc/php/{version}/cli/php.ini': { 'triggers': {
'source': f'{version}/php.ini', f'svc_systemd:php{version}-fpm:restart',
'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:'
},
}, },
} }
svc_systemd = { files[f'/etc/php/{version}/fpm/php.ini'] = {
f'php{version}-fpm': { 'source': f'{version}/php.ini',
'needs': { 'content_type': 'mako',
'pkg_apt:', 'context': {
f'file:/etc/php/{version}/fpm/php-fpm.conf', 'num_cpus': node.metadata.get('vm/cpu'),
f'file:/etc/php/{version}/fpm/php.ini', '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',
}, },
} }