Minor stylistic fixes.

This commit is contained in:
Dorian 2016-05-19 07:52:46 -04:00
parent 593a419261
commit 38e2717009
5 changed files with 21 additions and 19 deletions

View File

@ -9,9 +9,9 @@ nodejs_app_script: "src/index.js"
nodejs_app_root_path: "{{ web_root }}/{{ nodejs_app_name }}" nodejs_app_root_path: "{{ web_root }}/{{ nodejs_app_name }}"
nodejs_app_static_path: "{{ web_root }}/{{ nodejs_app_name }}/static" nodejs_app_static_path: "{{ web_root }}/{{ nodejs_app_name }}/static"
nodejs_app_nginx_hostname: localhost nodejs_app_hostname: localhost
nodejs_app_supervisor_command: "PORT={{ nodejs_app_port }} node {{ nodejs_app_root }}/{{ nodejs_app_script }}" nodejs_app_supervisor_command: "PORT={{ nodejs_app_port }} node {{ nodejs_app_root_path }}/{{ nodejs_app_script }}"
nodejs_version_family: "5.x" nodejs_version_family: "5.x"
# Other valid value is 4.x # Other valid value is 4.x

3
handlers/main.yml Normal file
View File

@ -0,0 +1,3 @@
- name: restart nodejs app
supervisorctl: name={{ nodejs_app_service_name }} state=restarted config=/etc/supervisor/supervisord.conf
sudo: yes

View File

@ -18,19 +18,18 @@ galaxy_info:
# #
# NOTE: A tag is limited to a single word comprised of # NOTE: A tag is limited to a single word comprised of
# alphanumeric characters. Maximum 20 tags per role. # alphanumeric characters. Maximum 20 tags per role.
# - role: "git+https://bitbucket.org/dorianpula/ansible-nodejs,,nodejs"
# - role: "git+https://bitbucket.org/dorianpula/ansible-nginx-uwsgi-supervisor,,nginx-uwsgi-supervisor"
dependencies: dependencies:
# - role: "git+https://bitbucket.org/dorianpula/ansible-nginx-uwsgi-supervisor,,nginx-uwsgi-supervisor"
- role: "nginx-supervisor"
nsbase_app_name: "{{ nodejs_app_name }}"
nsbase_app_root_path: "{{ nodejs_app_root_path }}"
nsbase_app_nginx_hostname: "{{ nodejs_app_nginx_hostname }}"
nsbase_app_service_name: "{{ nodejs_app_service_name }}"
nsbase_app_service_command: "{{ nodejs_app_supervisor_command }}"
nsbase_app_service_stop_signal: QUIT
nsbase_nginx_app_config: "{{ nodejs_app_nginx_config }}"
nsbase_app_nginx_static_path: "{{ nodejs_app_static_path }}"
# - role: "git+https://bitbucket.org/dorianpula/ansible-nodejs,,nodejs"
- role: "nodejs" - role: "nodejs"
node_version_family: "{{ nodejs_version_family }}" node_version_family: "{{ nodejs_version_family }}"
globally_installed_tools: nodejs_app_global_install globally_installed_tools: "{{ nodejs_app_global_install }}"
- role: nginx-supervisor
nsbase_app_name: "{{ nodejs_app_name }}"
nsbase_app_root_path: "{{ nodejs_app_root_path }}"
nsbase_app_hostname: "{{ nodejs_app_hostname }}"
nsbase_app_service_name: "{{ nodejs_app_service_name }}"
nsbase_app_service_command: "{{ nodejs_app_supervisor_command }}"
nsbase_app_service_stop_signal: QUIT
nsbase_app_nginx_config: "{{ nodejs_app_nginx_config }}"
nsbase_app_static_path: "{{ nodejs_app_static_path }}"

View File

@ -6,7 +6,7 @@
marker: "# -- {mark} NodeJS App config for {{ nodejs_app_name }} --" marker: "# -- {mark} NodeJS App config for {{ nodejs_app_name }} --"
block: | block: |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host; proxy_set_header Host $http_host;
proxy_pass 127.0.0.1:{{ nodejs_app_port }}; proxy_pass http://127.0.0.1:{{ nodejs_app_port }};
sudo: yes sudo: yes
notify: restart nginx notify: restart nginx

View File

@ -1,4 +1,4 @@
--- ---
# vars file for nodejs-nginx-supervisor # vars file for nodejs-nginx-supervisor
nodejs_app_nginx_config: "{{ app_name }}_nodejs_nginx.conf" nodejs_app_nginx_config: "{{ nodejs_app_name }}_nodejs_nginx.conf"
nodejs_app_service_name: "{{ app_name }}_nodejs" nodejs_app_service_name: "{{ nodejs_app_name }}_nodejs"