diff --git a/infra.yml b/infra.yml index 01af316..db28e01 100644 --- a/infra.yml +++ b/infra.yml @@ -31,6 +31,6 @@ # TEST - name: Test hosts: test - roles: ['stable/common', 'stable/nginx'] + roles: ['stable/common', 'stable/etherpad'] tags: test - vars_files: vars/frontend.yml + vars_files: vars/test.yml diff --git a/roles/stable/etherpad/handlers/main.yml b/roles/stable/etherpad/handlers/main.yml deleted file mode 100644 index 4e66530..0000000 --- a/roles/stable/etherpad/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: restart etherpad - service: - name: etherpad - state: restarted diff --git a/roles/stable/etherpad/tasks/main.yml b/roles/stable/etherpad/tasks/main.yml index 85999fc..3336fcd 100644 --- a/roles/stable/etherpad/tasks/main.yml +++ b/roles/stable/etherpad/tasks/main.yml @@ -1,6 +1,7 @@ --- - name: install etherpad deps + become: yes apt: pkg: - git @@ -8,6 +9,7 @@ - tidy - name: ensure etherpad user is present + become: yes user: name: "etherpad" home: "/srv/etherpad" @@ -18,13 +20,14 @@ git: repo: "https://github.com/ether/etherpad-lite" dest: "/srv/etherpad/etherpad" - version: "1.8.6" + version: "1.8.7" force: true become: true become_user: "etherpad" register: repository - name: ensure etherpad init.d is latest + become: yes template: src: etherpad.initd.j2 dest: /etc/init.d/etherpad @@ -33,6 +36,7 @@ mode: 0500 - name: copy etherpad settings.json + become: yes template: src: settings.json.j2 dest: /srv/etherpad/etherpad/settings.json @@ -41,6 +45,7 @@ mode: 0644 - name: ensure etherpad will start after system is booted + become: yes service: name: etherpad enabled: yes @@ -53,19 +58,20 @@ # chdir: /srv/etherpad/etherpad/ - name: copy custom assets + become: yes copy: src: "{{playbook_dir}}/assets/etherpad/{{item.key}}" dest: "{{item.value}}{{item.key}}" owner: etherpad group: etherpad - with_dict: "{{ override_files }}" + with_dict: "{{ override_files| default([]) }}" - name: remove package-lock.json + become: yes file: state: absent path: "/srv/etherpad/etherpad/package-lock.json" - - name: install etherpad plugins npm: name: "{{ item }}" @@ -73,4 +79,9 @@ become: true become_user: etherpad with_items: "{{ plugins|d() }}" - notify: restart etherpad + +- name: restart etherpad + become: true + service: + name: etherpad + state: restarted diff --git a/vars/test.yml b/vars/test.yml new file mode 100644 index 0000000..4ad1d9d --- /dev/null +++ b/vars/test.yml @@ -0,0 +1,10 @@ +--- +with_certbot: true +with_nginx: true +with_backup: true +certbot_email: info@cisti.org +servers: + - cicles: + server_name: antani.cisti.org + proxy_pass: http://localhost:8001 +