From 620a1f611c00038317b092438accbea3783e4a2f Mon Sep 17 00:00:00 2001 From: David Farrington Date: Mon, 12 Jan 2015 16:38:33 +0000 Subject: [PATCH 1/2] Avoid recompiling nginx, FIXES #10 --- tasks/source.yml | 12 ++++++++++++ templates/.nginx_compilation_flags.j2 | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 templates/.nginx_compilation_flags.j2 diff --git a/tasks/source.yml b/tasks/source.yml index 8a7f68e..23e6092 100644 --- a/tasks/source.yml +++ b/tasks/source.yml @@ -22,12 +22,24 @@ - name: Nginx | Unpack the compressed Nginx source command: tar -xvzf /tmp/nginx-{{nginx_source_version}}.tar.gz chdir=/tmp creates=/tmp/nginx-{{nginx_source_version}}/README +- name: Nginx | Write out the version and flags used for the build + template: + src: .nginx_compilation_flags.j2 + dest: /usr/local/nginx/.nginx_compilation_flags + register: nginx_flags + +- name: Kill Nginx (old threads) + command: pkill nginx + ignore_errors: yes + when: nginx_flags.changed + - name: Nginx | Compile the Nginx source shell: > cd /tmp/nginx-{{nginx_source_version}} && ./configure {{nginx_source_configure_flags}} && make && make install + when: nginx_flags.changed - name: Nginx | Update the symbolic link to the nginx install file: diff --git a/templates/.nginx_compilation_flags.j2 b/templates/.nginx_compilation_flags.j2 new file mode 100644 index 0000000..a831263 --- /dev/null +++ b/templates/.nginx_compilation_flags.j2 @@ -0,0 +1,3 @@ +# This file is used to track the nginx build flags, DO NOT CHANGE MANUALLY +{{nginx_source_version}} +{{nginx_source_configure_flags}} From a6a59bf13eaf86c461039448cb2e7b632a818735 Mon Sep 17 00:00:00 2001 From: David Farrington Date: Tue, 13 Jan 2015 13:59:45 +0000 Subject: [PATCH 2/2] Use location that already exists --- tasks/source.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/source.yml b/tasks/source.yml index 23e6092..cf3cd33 100644 --- a/tasks/source.yml +++ b/tasks/source.yml @@ -25,7 +25,7 @@ - name: Nginx | Write out the version and flags used for the build template: src: .nginx_compilation_flags.j2 - dest: /usr/local/nginx/.nginx_compilation_flags + dest: "{{nginx_dir}}/.nginx_compilation_flags" register: nginx_flags - name: Kill Nginx (old threads)