diff --git a/parse_server/defaults/main.yml b/parse_server/defaults/main.yml new file mode 100644 index 00000000..aee7d62f --- /dev/null +++ b/parse_server/defaults/main.yml @@ -0,0 +1,11 @@ +--- +parse_server_user: parsesrv +parse_server_user_home: /srv/parse +parse_server_npm_modules: + - parse-server + - pm2 + +parse_server_http_port: 1337 +parse_server_db: parse_db +parse_server_mongodb_url: 'mongodb://localhost:27017/{{ parse_server_db }}' + diff --git a/parse_server/meta/main.yml b/parse_server/meta/main.yml new file mode 100644 index 00000000..a60de378 --- /dev/null +++ b/parse_server/meta/main.yml @@ -0,0 +1,4 @@ +--- +dependencies: + - role: '../../library/roles/nginx' + - role: '../../library/roles/node_js' diff --git a/parse_server/tasks/main.yml b/parse_server/tasks/main.yml new file mode 100644 index 00000000..1cb0562e --- /dev/null +++ b/parse_server/tasks/main.yml @@ -0,0 +1,13 @@ +--- +- block: + - name: Create the parse user + user: name={{ parse_server_user }} home={{ parse_server_user_home }} createhome=no system=yes shell=/bin/bash + + - name: Create the parse home directory + file: dest={{ parse_server_user_home }} owner={{ parse_server_user }} group={{ parse_server_user }} mode=0755 state=directory + + - name: Install the parse server + npm: name={{ item }} global=yes state=present production=true + with_items: '{{ parse_server_npm_modules }}' + + tags: [ 'parse', 'parse_server' ] diff --git a/parse_server/vars/main.yml b/parse_server/vars/main.yml new file mode 100644 index 00000000..04c72dc1 --- /dev/null +++ b/parse_server/vars/main.yml @@ -0,0 +1,3 @@ +--- +mongodb_version: 3.2 +node_js_repo_version: 8