From c552dd3642df92a7cdf65dd6b48e9e6d0393e376 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Tue, 30 May 2023 15:30:25 +0200 Subject: [PATCH] :rocket: Add core options --- README.md | 1 + defaults/main.yml | 1 + templates/etc/nginx/nginx.conf.j2 | 3 +++ tests/group_vars/all.yml | 2 ++ 4 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 883ad21..e99b022 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ FreeBSD: - `nginx_pid`: daemon pid file - `nginx_events_*`: all variables in events block - `nginx_http_*`: all variables in http block +- `nginx_custom_core`: instructions list (for core, will put data in `/etc/nginx/nginx.conf`) - `nginx_custom_http`: instructions list (will put data in `/etc/nginx/conf.d/custom.conf`) - `nginx_module_packages`: package list module to install (Debian) - `nginx_load_modules`: module list to load (full path), should be used only on FreeBSD diff --git a/defaults/main.yml b/defaults/main.yml index c9adbf8..c83c350 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -84,6 +84,7 @@ nginx_http_gzip_disable: '"msie6"' # Custom global configuration # nginx_custom_http: [] +nginx_custom_core: [] # # Nginx default diff --git a/templates/etc/nginx/nginx.conf.j2 b/templates/etc/nginx/nginx.conf.j2 index 23f5ac6..bec0208 100644 --- a/templates/etc/nginx/nginx.conf.j2 +++ b/templates/etc/nginx/nginx.conf.j2 @@ -5,6 +5,9 @@ user {{ nginx_user }}; worker_processes {{ nginx_worker_processes }}; pid {{ nginx_pid }}; +{% for i in nginx_custom_core %} +{{ i }} +{% endfor %} include {{ nginx_etc_dir }}/modules-enabled/*.conf; events { diff --git a/tests/group_vars/all.yml b/tests/group_vars/all.yml index b5dc0e5..c7cc678 100644 --- a/tests/group_vars/all.yml +++ b/tests/group_vars/all.yml @@ -6,6 +6,8 @@ int_ansible_ssl_dir: '/etc/ansible-ssl' nginx_worker_processes: 1 # Ansible+FreeBSD can't detect CPU number nginx_apt_package: 'nginx-extras' nginx_module_packages: ['libnginx-mod-http-headers-more-filter'] +nginx_custom_core: + - 'worker_rlimit_nofile 4242;' nginx_upstreams: - name: 'test'