diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-10-11 20:40:32 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-10-11 20:41:07 -0400 |
commit | 8e290130b47b7f3b9d442c8d6531218eb2f09867 (patch) | |
tree | c8fab9bc27ab3f447524939ea8b2940b6080fba1 /pad/tasks | |
parent | 6d1743c83e239806b1b6fb635e184a59a5f28f5a (diff) | |
download | emacsconf-ansible-8e290130b47b7f3b9d442c8d6531218eb2f09867.tar.xz emacsconf-ansible-8e290130b47b7f3b9d442c8d6531218eb2f09867.zip |
Yay, pads are created based on the talks.json file
Also, the playbook waits until the pad is up
Diffstat (limited to '')
-rw-r--r-- | pad/tasks/main.yml | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/pad/tasks/main.yml b/pad/tasks/main.yml index ab15984..8637406 100644 --- a/pad/tasks/main.yml +++ b/pad/tasks/main.yml @@ -12,6 +12,7 @@ apt: update_cache: yes name: + - systemd - sudo - nodejs - mariadb-server @@ -34,14 +35,57 @@ template: src: templates/settings.json dest: "{{ etherpad_path }}/settings.json" -# - name: Install etherpad plugins -# npm: -# name: ep_stats -# path: "{{ etherpad_path }}" -# become: true -# become_user: etherpad +- name: Set etherpad API key + copy: + content: "{{ etherpad_api_key }}" + dest: "{{ etherpad_path }}/APIKEY.txt" + owner: "{{ etherpad_user }}" + mode: "0600" - name: Install dependencies shell: cd {{ etherpad_path }}; . src/bin/functions.sh; src/bin/installDeps.sh become: true become_user: etherpad +- name: Install etherpad plugins + npm: + name: ep_pad-lister + path: "{{ etherpad_path }}" + become: true + become_user: etherpad - include: mariadb.yml +- name: Install init.d configuration + tags: system + template: + src: etherpad.init.d + dest: /etc/init.d/etherpad + owner: root + group: root + mode: 0755 +- name: Start Etherpad + tags: system + service: + name: etherpad + state: started +- tags: create-pads + include_vars: + file: talks.json + name: talks +- name: Set slugs + tags: create-pads + set_fact: + slugs: +- name: Wait for OK + tags: create-pads + uri: + url: "http://localhost:9001/api/1/createPad?apikey={{ etherpad_api_key }}&padID={{etherpad_base}}-{{etherpad_year}}" + register: _result + until: _result.status == 200 + retries: 720 + delay: 5 +- debug: + var: _result + tags: create-pads +- name: Create pads + tags: create-pads + uri: + url: "http://localhost:9001/api/1/createPad?apikey={{ etherpad_api_key }}&padID={{etherpad_base}}-{{etherpad_year}}-{{ item.slug }}" + loop: "{{ talks | json_query('talks[*]') }}" |