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_user': 'admin',
'admin_pass': repo.vault.password_for(f'{node.name} nextcloud admin pw'), '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': { 'postgresql': {
'roles': { 'roles': {
'nextcloud': { 'nextcloud': {

View file

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

View file

@ -1,10 +1,32 @@
defaults = { defaults = {
'php': { 'php': {
'post_max_size': '32G', 'post_max_size': '32G',
}, 'www.conf': {
'apt': { 'user': 'www-data',
'packages': { 'group': 'www-data',
'php': {}, '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': {},
},
},
}