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 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