nextcloud php www.conf

This commit is contained in:
mwiegand 2021-11-13 15:17:20 +01:00
parent 715e163514
commit 6c2473e2da
3 changed files with 55 additions and 11 deletions

View file

@ -41,6 +41,16 @@ defaults = {
'admin_user': 'admin',
'admin_pass': repo.vault.password_for(f'{node.name} nextcloud admin pw'),
},
'php': {
'post_max_size': '32G',
'www.conf': {
'env[hostname]': '$HOSTNAME',
'env[path]': '/usr/local/bin:/usr/bin:/bin',
'env[tmp]': '/tmp',
'env[tmpdir]': '/tmp',
'env[temp]': '/tmp',
},
},
'postgresql': {
'roles': {
'nextcloud': {

View file

@ -6,23 +6,35 @@ php_ini_context = {
}
files = {
f'/etc/php/{version}/cli/php.ini': {
'content_type': 'mako',
'context': php_ini_context,
'needs': {
f'pkg_apt:php{version}',
f'pkg_apt:php{version}-fpm',
},
},
f'/etc/php/{version}/fpm/php.ini': {
'content_type': 'mako',
'context': php_ini_context,
'needs': {
# "all php packages"
'pkg_apt:'
f'pkg_apt:php{version}',
f'pkg_apt:php{version}-fpm',
},
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
},
},
f'/etc/php/{version}/cli/php.ini': {
'content_type': 'mako',
'context': php_ini_context,
f'/etc/php/{version}/fpm/pool.d/www.conf': {
'content': repo.libs.ini.dumps({
'www': node.metadata.get('php/www.conf'),
}),
'needs': {
# "all php packages"
'pkg_apt:'
f'pkg_apt:php{version}',
f'pkg_apt:php{version}-fpm',
},
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
},
},
}

View file

@ -1,10 +1,32 @@
defaults = {
'php': {
'post_max_size': '32G',
},
'apt': {
'packages': {
'php': {},
'www.conf': {
'user': 'www-data',
'group': 'www-data',
'listen': '/run/php/php7.4-fpm.sock',
'listen.owner': 'www-data',
'listen.group': 'www-data',
'pm': 'dynamic',
'pm.max_children': '5',
'pm.start_servers': '2',
'pm.min_spare_servers': '1',
'pm.max_spare_servers': '3',
},
},
}
@metadata_reactor.provides(
'apt/packages',
)
def apt(metadata):
version = metadata.get('php/version')
return {
'apt': {
'packages': {
f'php{version}': {},
f'php{version}-fpm': {},
},
},
}