82c9e1f51a8276c62d8fe9a71bb7cf4729cdea81
[ansible.git] / roles / etherpad / tasks / main.yml
1 - name: create nodejs user
2   user:
3     name: nodejs
4     system: yes
5     group: nogroup
6     home: /var/lib/nodejs
7     shell: /bin/false
8 - name: create etherpad dir
9   file: path=/srv/{{etherpad.domain}} state=directory owner=nodejs group=www-data
10 - name: check out etherpad sources
11   become_user: nodejs
12   register: etherpad_src
13   git:
14     dest: /srv/{{etherpad.domain}}/etherpad-lite
15     repo: 'https://github.com/ether/etherpad-lite.git'
16     version: '1.6.6'
17     force: yes
18 - name: create etherpad service file
19   register: etherpad_service
20   template:
21     dest: /etc/systemd/system/etherpad-lite.service
22     src: templates/etherpad-lite.service
23 - name: configure etherpad
24   register: etherpad_settings
25   template:
26     dest: /srv/{{etherpad.domain}}/etherpad-lite/settings.json
27     src: templates/settings.json
28     mode: u=rw,g=,o=
29     owner: nodejs
30     group: nogroup
31 - name: (re)start and enable etherpad service
32   when: etherpad_src.changed or etherpad_service.changed or etherpad_settings.changed
33   systemd: name=etherpad-lite state=restarted daemon_reload=yes enabled=yes