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