From 58b3b71077ea04c705a8c0ead7951387df725aa1 Mon Sep 17 00:00:00 2001 From: Robert August Vincent II Date: Thu, 21 Mar 2019 08:32:27 -0400 Subject: [PATCH 1/2] Add configuration variable for starting nginx service. --- defaults/main.yml | 4 ++++ handlers/main.yml | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 60f5b1b..a059b3b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,6 +3,10 @@ # Default is true. nginx_enable: true +# Start NGINX service. +# Default is true +nginx_start: true + # Print NGINX configuration file to terminal after executing playbook. nginx_debug_output: false diff --git a/handlers/main.yml b/handlers/main.yml index 15903fa..837f7b7 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,30 +4,36 @@ name: nginx state: started enabled: yes + when: nginx_start - name: "(Handler: All OSs) Reload NGINX" service: name: nginx state: reloaded + when: nginx_start - name: "(Handler: All OSs) Start NGINX Amplify Agent" service: name: amplify-agent state: started + when: nginx_start - name: "(Handler: All OSs) Start NGINX Controller Agent" service: name: controller-agent state: started + when: nginx_start - name: "(Handler: Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit" service: name: unit state: started enabled: yes + when: nginx_start - name: "(Handler: FreeBSD) Start NGINX Unit" service: name: unitd state: started enabled: yes + when: nginx_start From 29a87f09c3a89c516cf6aabb2c2bfbc2d08c9194 Mon Sep 17 00:00:00 2001 From: Robert August Vincent II Date: Thu, 21 Mar 2019 08:35:34 -0400 Subject: [PATCH 2/2] Document nginx_start variable. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 170b51a..312afd7 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,10 @@ This role has multiple variables. The defaults for all these variables are the f # Default is true. nginx_enable: true +# Start NGINX service. +# Default is true. +nginx_start: true + # Print NGINX configuration file to terminal after executing playbook. nginx_debug_output: false