Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

81 lines
2.5 KiB

---
- name: Install dependencies
yum:
name:
- nodejs
notify: restart etherpad
tags: etherpad
- name: Download etherpad
get_url:
url: "{{ etherpad_archive_url }}"
dest: "{{ etherpad_root_dir }}/tmp"
checksum: "sha1:{{ etherpad_archive_sha1 }}"
when: etherpad_install_mode != 'none'
tags: etherpad
- name: Extract etherpad
unarchive:
src: "{{ etherpad_root_dir }}/tmp/etherpad-lite-{{ etherpad_version }}.tar.gz"
dest: "{{ etherpad_root_dir }}/tmp/"
remote_src: True
when: etherpad_install_mode != 'none'
tags: etherpad
- name: Move etherpad to its correct dir
synchronize:
src: "{{ etherpad_root_dir }}/tmp/etherpad-lite-{{ etherpad_version }}/"
dest: "{{ etherpad_root_dir }}/web/"
recursive: True
delete: True
delegate_to: "{{ inventory_hostname }}"
become_user: "{{ etherpad_user }}"
when: etherpad_install_mode != 'none'
tags: etherpad
- name: Ensure node_modules dir exists
file: path={{ etherpad_root_dir }}/web/node_modules state=directory
tags: etherpad
- name: Link etherpad sources in node_modules
file: src={{ etherpad_root_dir }}/web/src dest={{ etherpad_root_dir }}/web/node_modules/ep_etherpad-lite state=link
tags: etherpad
- name: Install node modules
npm: path={{ etherpad_root_dir }}/web/node_modules/ep_etherpad-lite production=True state={{ (etherpad_install_mode == 'none') | ternary('present','latest') }}
become_user: "{{ etherpad_user }}"
tags: etherpad
- name: Install plugins
npm: name=ep_{{ item }} path={{ etherpad_root_dir }}/web/node_modules/ep_etherpad-lite production=True state={{ (etherpad_install_mode == 'none') | ternary('present','latest') }}
loop: "{{ etherpad_plugins }}"
become_user: "{{ etherpad_user }}"
notify: restart etherpad
tags: etherpad
- import_tasks: ../includes/webapps_create_mysql_db.yml
vars:
- db_name: "{{ etherpad_db_name }}"
- db_user: "{{ etherpad_db_user }}"
- db_server: "{{ etherpad_db_server }}"
- db_pass: "{{ etherpad_db_pass }}"
tags: etherpad
- name: Deploy systemd unit
template: src=etherpad.service.j2 dest=/etc/systemd/system/etherpad_{{ etherpad_id }}.service
register: etherpad_unit
notify: restart etherpad
tags: etherpad
- name: Reload systemd
systemd: daemon_reload=True
when: etherpad_unit.changed
tags: etherpad
- name: Deploy pre/post backup scripts
template: src={{ item }}_backup.sh.j2 dest=/etc/backup/{{ item }}.d/etherpad_{{ etherpad_id }}.sh mode=750
loop:
- pre
- post
tags: etherpad