main.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ---
  2. - name: install etherpad deps
  3. become: yes
  4. apt:
  5. pkg:
  6. - git
  7. - libreoffice-common
  8. - tidy
  9. - name: ensure etherpad user is present
  10. become: yes
  11. user:
  12. name: "etherpad"
  13. home: "/srv/etherpad"
  14. shell: "/bin/bash"
  15. state: present
  16. - name: ensure etherpad is correct version
  17. git:
  18. repo: "https://github.com/ether/etherpad-lite"
  19. dest: "/srv/etherpad/etherpad"
  20. version: "1.8.7"
  21. force: true
  22. become: true
  23. become_user: "etherpad"
  24. register: repository
  25. - name: ensure etherpad init.d is latest
  26. become: yes
  27. template:
  28. src: etherpad.initd.j2
  29. dest: /etc/init.d/etherpad
  30. owner: root
  31. group: root
  32. mode: 0500
  33. - name: copy etherpad settings.json
  34. become: yes
  35. template:
  36. src: settings.json.j2
  37. dest: /srv/etherpad/etherpad/settings.json
  38. owner: etherpad
  39. group: etherpad
  40. mode: 0644
  41. - name: ensure etherpad will start after system is booted
  42. become: yes
  43. service:
  44. name: etherpad
  45. enabled: yes
  46. # - name: install etherpad deps
  47. # become: true
  48. # become_user: etherpad
  49. # shell: /srv/etherpad/etherpad/bin/installDeps.sh
  50. # args:
  51. # chdir: /srv/etherpad/etherpad/
  52. - name: copy custom assets
  53. become: yes
  54. copy:
  55. src: "{{playbook_dir}}/assets/etherpad/{{item.key}}"
  56. dest: "{{item.value}}{{item.key}}"
  57. owner: etherpad
  58. group: etherpad
  59. with_dict: "{{ override_files| default([]) }}"
  60. - name: remove package-lock.json
  61. become: yes
  62. file:
  63. state: absent
  64. path: "/srv/etherpad/etherpad/package-lock.json"
  65. - name: install etherpad plugins
  66. npm:
  67. name: "{{ item }}"
  68. path: "/srv/etherpad/etherpad"
  69. become: true
  70. become_user: etherpad
  71. with_items: "{{ plugins|d() }}"
  72. - name: restart etherpad
  73. become: true
  74. service:
  75. name: etherpad
  76. state: restarted