commit 6869095e6094ee308307f0ab6f60887fe3d57e96 Author: Dorian Pula Date: Tue May 17 08:45:05 2016 -0400 Initial setup of role based on work from ansible-rookeries. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..af775a9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +## Directory-based project format: +.idea/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..36bbf62 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +--- +language: python +python: "2.7" + +# Use the new container infrastructure +sudo: false + +# Install ansible +addons: + apt: + packages: + - python-pip + +install: + # Install ansible + - pip install ansible + + # Check ansible version + - ansible --version + + # Create ansible.cfg with correct roles_path + - printf '[defaults]\nroles_path=../' >ansible.cfg + +script: + # Basic role syntax check + - ansible-playbook tests/test.yml -i tests/inventory --syntax-check + +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8efa7b6 --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +Ansible nodejs-nginx-supervisor +=============================== + +An Ansible role to setup and manage a NodeJS app via supervisor, and served up on a NGINX web server. The goal of this +role is to make deployment of a NodeJS app as a simple and sane as possible. Additionally the role uses the underlying +nginx-supervisor to provide sane defaults for logging and folder structure setup. + +**This role is under development and is unstable.** + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +Dorian Pula + +- twitter: @dorianpula +- email: dorian.pula at amber-penguin.software.ca +- www: http://amber-penguin-software.ca + + +Repositories +------------ + +- Main: https://bitbucket.org/dorianpula/ansible-nodejs-nginx-supervisor + - All development and issues are worked on this repo. +- nodejs base role: https://bitbucket.org/dorianpula/ansible-nodejs +- nginx-supervisor base role: https://bitbucket.org/dorianpula/ansible-nginx-supervisor diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..81950b9 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,4 @@ +--- +# defaults file for nodejs-nginx-supervisor + +app_name: "nodejs_app" diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..c2868f4 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for nodejs-nginx-supervisor diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..66e5cee --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,38 @@ +galaxy_info: + author: your name + description: + company: your company (optional) + license: BSD + + min_ansible_version: 2.0 + platforms: + - name: Ubuntu + versions: + - trusty + - xenial + galaxy_tags: [] + # List tags for your role here, one per line. A tag is + # a keyword that describes and categorizes the role. + # Users find roles by searching for tags. Be sure to + # remove the '[]' above if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of + # alphanumeric characters. Maximum 20 tags per role. + +dependencies: + # - role: "git+https://bitbucket.org/dorianpula/ansible-nginx-uwsgi-supervisor,,nginx-uwsgi-supervisor" + - role: "nginx-supervisor" + nsbase_app_name: "{{ app_name }}" + nsbase_app_root_path: "{{ app_root_path }}" + nsbase_app_nginx_hostname: "{{ app_nginx_hostname }}" + nsbase_app_service_name: "{{ nodejs_app_service_name }}" + nsbase_app_service_command: "{{ nodejs_supervisor_app_command }}" + nsbase_app_service_stop_signal: QUIT + nsbase_nginx_app_config: "{{ nodejs_nginx_app_config }}" +# - role: "git+https://bitbucket.org/dorianpula/ansible-nodejs,,nodejs" + - role: "nodejs" + node_version_family: "5.x" + globally_installed_tools: + - browserify + - babel-cli + - less diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..0e8fb58 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,2 @@ +--- +# tasks file for nodejs-nginx-supervisor diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..d18580b --- /dev/null +++ b/tests/inventory @@ -0,0 +1 @@ +localhost \ No newline at end of file diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..f45f877 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - nodejs-nginx-supervisor \ No newline at end of file diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..9d563b4 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for nodejs-nginx-supervisor