bundles/nginx: prepare for arch linux

This commit is contained in:
Franzi 2021-06-01 16:52:03 +02:00
parent 6b90d568cf
commit cf3c45fdd5
Signed by: kunsi
GPG key ID: 12E3D2136B818350
4 changed files with 35 additions and 3 deletions

View file

@ -0,0 +1,9 @@
[Service]
ExecStart=
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=
ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/nginx.pid)"
ExecStop=
ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/nginx.pid)"

View file

@ -1,4 +1,4 @@
user www-data;
user ${username};
worker_processes ${worker_processes};
pid /var/run/nginx.pid;

View file

@ -1,3 +1,10 @@
if node.has_bundle('pacman'):
package = 'pkg_pacman:nginx'
username = 'http'
else:
package = 'pkg_apt:nginx'
username = 'www-data'
directories = {
'/etc/nginx/sites': {
'purge': True,
@ -17,7 +24,10 @@ directories = {
files = {
'/etc/nginx/nginx.conf': {
'content_type': 'mako',
'context': node.metadata['nginx'],
'context': {
'username': username,
**node.metadata['nginx'],
},
'triggers': {
'svc_systemd:nginx:restart',
},
@ -42,6 +52,14 @@ files = {
'mode': '0755',
},
}
if node.has_bundle('pacman'):
files['/etc/systemd/system/nginx.service.d/bundlewrap.conf'] = {
'source': 'arch-override.conf',
'triggers': {
'action:systemd-reload',
'svc_systemd:nginx:restart',
},
}
actions = {
'nginx-generate-dhparam': {
@ -54,7 +72,7 @@ svc_systemd = {
'nginx': {
'needs': {
'action:nginx-generate-dhparam',
'pkg_apt:nginx',
package,
},
},
}

View file

@ -33,6 +33,11 @@ defaults = {
'nginx': {
'worker_connections': 768,
},
'pacman': {
'packages': {
'nginx': {},
},
},
}
if node.has_bundle('telegraf'):