summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Belanger <pabelanger@redhat.com>2015-12-07 13:19:09 -0500
committerPaul Belanger <pabelanger@redhat.com>2015-12-07 13:19:09 -0500
commita89bf0f57254d91fe65242773f77cbe87a7da534 (patch)
tree761797a4685c3fbb3d33b2baeb72e6f218c1dbcb
parent2b150dc97105891c38340850fc214ffa991dfbae (diff)
Override default nginx.conf file
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
-rw-r--r--defaults/main.yaml3
-rw-r--r--files/etc/nginx/nginx.conf30
-rw-r--r--tasks/config.yaml6
3 files changed, 39 insertions, 0 deletions
diff --git a/defaults/main.yaml b/defaults/main.yaml
index e66d1e4..f9d1679 100644
--- a/defaults/main.yaml
+++ b/defaults/main.yaml
@@ -13,3 +13,6 @@
13# under the License. 13# under the License.
14--- 14---
15nginx_config_include_files: [] 15nginx_config_include_files: []
16
17nginx_file_nginx_conf: etc/nginx/nginx.conf
18nginx_file_nginx_conf_dest: /etc/nginx/nginx.conf
diff --git a/files/etc/nginx/nginx.conf b/files/etc/nginx/nginx.conf
new file mode 100644
index 0000000..6a94b90
--- /dev/null
+++ b/files/etc/nginx/nginx.conf
@@ -0,0 +1,30 @@
1user nginx;
2worker_processes auto;
3error_log /var/log/nginx/error.log;
4pid /run/nginx.pid;
5
6events {
7 worker_connections 1024;
8}
9
10http {
11 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
12 '$status $body_bytes_sent "$http_referer" '
13 '"$http_user_agent" "$http_x_forwarded_for"';
14
15 access_log /var/log/nginx/access.log main;
16
17 sendfile on;
18 tcp_nopush on;
19 tcp_nodelay on;
20 keepalive_timeout 65;
21 types_hash_max_size 2048;
22
23 include /etc/nginx/mime.types;
24 default_type application/octet-stream;
25
26 # Load modular configuration files from the /etc/nginx/conf.d directory.
27 # See http://nginx.org/en/docs/ngx_core_module.html#include
28 # for more information.
29 include /etc/nginx/conf.d/*.conf;
30}
diff --git a/tasks/config.yaml b/tasks/config.yaml
index 5ae9016..7a485e5 100644
--- a/tasks/config.yaml
+++ b/tasks/config.yaml
@@ -20,3 +20,9 @@
20 notify: 20 notify:
21 - Restart nginx 21 - Restart nginx
22 - Validate nginx 22 - Validate nginx
23
24- name: Copy nginx configuration file.
25 copy:
26 dest: "{{ nginx_file_nginx_conf_dest }}"
27 src: "{{ nginx_file_nginx_conf }}"
28 notify: Restart nginx