2018-09-07 19:24:59 +02:00
|
|
|
---
|
|
|
|
- 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
|
|
|
|
|
2018-12-10 17:20:13 +01:00
|
|
|
- name: Create the parse config directory
|
|
|
|
file: dest={{ parse_server_config_dir }} owner={{ parse_server_user }} group={{ parse_server_user }} mode=0750 state=directory
|
|
|
|
|
2018-09-07 19:24:59 +02:00
|
|
|
- name: Install the parse server
|
|
|
|
npm: name={{ item }} global=yes state=present production=true
|
|
|
|
with_items: '{{ parse_server_npm_modules }}'
|
|
|
|
|
2018-12-10 17:20:13 +01:00
|
|
|
- name: Install the parse server environment file
|
|
|
|
template: src=parse-server.env dest={{ parse_server_config_dir }}/parse-server.env owner={{ parse_server_user }} group={{ parse_server_user }} mode=0640
|
|
|
|
|
2018-12-06 21:18:14 +01:00
|
|
|
- name: Install the parse server startup script
|
|
|
|
template: src=parse_server.upstart.j2 dest=/etc/init/parse_server.conf mode=0644
|
|
|
|
|
|
|
|
- name: Ensure that the parse service is started and enabled
|
|
|
|
service: name=parse_server state=started enabled=yes
|
|
|
|
|
2018-09-07 19:24:59 +02:00
|
|
|
tags: [ 'parse', 'parse_server' ]
|
2018-12-06 21:18:14 +01:00
|
|
|
|
|
|
|
- block:
|
|
|
|
|
|
|
|
- name: Install the parse server dashboard
|
|
|
|
npm: name={{ item }} global=yes state=present production=true
|
|
|
|
with_items: '{{ parse_server_dashboard_npm_modules }}'
|
|
|
|
|
|
|
|
- name: Install the parse dashboard environment variables file
|
2018-12-10 17:20:13 +01:00
|
|
|
template: src=parse-server-dashboard.env dest={{ parse_server_config_dir }}/parse-server-dashboard.env owner={{ parse_server_user }} group={{ parse_server_user }} mode=0640
|
2018-12-06 21:18:14 +01:00
|
|
|
|
|
|
|
- name: Install the parse dashboard configuration file
|
2018-12-10 17:20:13 +01:00
|
|
|
template: src=parse-dashboard-config.json dest={{ parse_server_config_dir }}/parse-dashboard-config.json owner={{ parse_server_user }} group={{ parse_server_user }} mode=0640
|
2018-12-06 21:18:14 +01:00
|
|
|
|
|
|
|
- name: Install the parse dashboard startup script
|
|
|
|
template: src=parse_server_dashboard.upstart.j2 dest=/etc/init/parse_server_dashboard.conf mode=0644
|
|
|
|
|
|
|
|
- name: Ensure that the parse dashboard service is started and enabled
|
|
|
|
service: name=parse_server_dashboard state=started enabled=yes
|
|
|
|
|
|
|
|
when: parse_server_dashboard_install
|
|
|
|
tags: [ 'parse', 'parse_server', 'parse_server_dashboard' ]
|