parent
02cca6b343
commit
e0bcc3ef3e
12 changed files with 118 additions and 98 deletions
@ -1,9 +1,28 @@ |
|||||||
--- |
--- |
||||||
|
|
||||||
- import_tasks: ../includes/webapps_archive.yml |
- name: Create archive dir |
||||||
vars: |
file: path={{ etherpad_root_dir }}/archives/{{ etherpad_current_version }} state=directory mode=700 |
||||||
- root_dir: "{{ etherpad_root_dir }}" |
|
||||||
- version: "{{ current_version }}" |
|
||||||
- db_name: "{{ etherpad_db_name }}" |
|
||||||
tags: etherpad |
tags: etherpad |
||||||
|
|
||||||
|
- name: Archive previous version |
||||||
|
synchronize: |
||||||
|
src: "{{ etherpad_root_dir }}/{{ etherpad_web_dir.stat.exists | ternary('web','app') }}" # previous versions were installed in the web subdir, now in app) |
||||||
|
dest: "{{ etherpad_root_dir }}/archives/{{ etherpad_current_version }}/" |
||||||
|
compress: False |
||||||
|
delete: True |
||||||
|
delegate_to: "{{ inventory_hostname }}" |
||||||
|
tags: etherpad |
||||||
|
|
||||||
|
- name: Dump the database |
||||||
|
mysql_db: |
||||||
|
state: dump |
||||||
|
name: "{{ etherpad_db_name }}" |
||||||
|
target: "{{ etherpad_root_dir }}/archives/{{ etherpad_current_version }}/{{ etherpad_db_name }}.sql.xz" |
||||||
|
login_host: "{{ etherpad_db_server | default(mysql_server) }}" |
||||||
|
login_user: "{{ etherpad_db_user }}" |
||||||
|
login_password: "{{ etherpad_db_pass }}" |
||||||
|
quick: True |
||||||
|
single_transaction: True |
||||||
|
environment: |
||||||
|
XZ_OPT: -T0 |
||||||
|
tags: etherpad |
||||||
|
@ -1,8 +1,10 @@ |
|||||||
--- |
--- |
||||||
|
|
||||||
- name: Remove temp files |
- name: Remove temp and obsolete files |
||||||
file: path={{ etherpad_root_dir }}/tmp/{{ item }} state=absent |
file: path={{ etherpad_root_dir }}/{{ item }} state=absent |
||||||
loop: |
loop: |
||||||
- etherpad-lite-{{ etherpad_version }} |
- tmp/etherpad-lite-{{ etherpad_version }} |
||||||
- etherpad-lite-{{ etherpad_version }}.tar.gz |
- tmp/etherpad-lite-{{ etherpad_version }}.tar.gz |
||||||
|
- web |
||||||
|
- db_dumps |
||||||
tags: etherpad |
tags: etherpad |
||||||
|
@ -1,44 +1,46 @@ |
|||||||
--- |
--- |
||||||
|
|
||||||
- import_tasks: ../includes/webapps_set_install_mode.yml |
- block: |
||||||
vars: |
- import_tasks: ../includes/webapps_set_install_mode.yml |
||||||
root_dir: "{{ etherpad_root_dir }}" |
vars: |
||||||
version: "{{ etherpad_version }}" |
root_dir: "{{ etherpad_root_dir }}" |
||||||
tags: etherpad |
version: "{{ etherpad_version }}" |
||||||
- set_fact: etherpad_install_mode={{ install_mode }} |
- set_fact: etherpad_install_mode={{ install_mode }} |
||||||
|
- set_fact: etherpad_current_version={{ current_version | default('') }} |
||||||
tags: etherpad |
tags: etherpad |
||||||
|
|
||||||
- import_tasks: ../includes/get_rand_pass.yml |
- when: etherpad_db_pass is not defined |
||||||
vars: |
block: |
||||||
- pass_file: "{{etherpad_root_dir }}/meta/ansible_dbpass" |
- import_tasks: ../includes/get_rand_pass.yml |
||||||
when: etherpad_db_pass is not defined |
vars: |
||||||
tags: etherpad |
- pass_file: "{{etherpad_root_dir }}/meta/ansible_dbpass" |
||||||
- set_fact: etherpad_db_pass={{ rand_pass }} |
- set_fact: etherpad_db_pass={{ rand_pass }} |
||||||
when: etherpad_db_pass is not defined |
|
||||||
tags: etherpad |
tags: etherpad |
||||||
|
|
||||||
- import_tasks: ../includes/get_rand_pass.yml |
- block: |
||||||
vars: |
- import_tasks: ../includes/get_rand_pass.yml |
||||||
- pass_file: "{{etherpad_root_dir }}/meta/ansible_session_key" |
vars: |
||||||
tags: etherpad |
- pass_file: "{{etherpad_root_dir }}/meta/ansible_session_key" |
||||||
- set_fact: etherpad_session_key={{ rand_pass }} |
- set_fact: etherpad_session_key={{ rand_pass }} |
||||||
tags: etherpad |
tags: etherpad |
||||||
|
|
||||||
- import_tasks: ../includes/get_rand_pass.yml |
- when: etherpad_api_key is not defined |
||||||
vars: |
block: |
||||||
- pass_file: "{{etherpad_root_dir }}/meta/ansible_api_key" |
- import_tasks: ../includes/get_rand_pass.yml |
||||||
when: etherpad_api_key is not defined |
vars: |
||||||
tags: etherpad |
- pass_file: "{{etherpad_root_dir }}/meta/ansible_api_key" |
||||||
- set_fact: etherpad_api_key={{ rand_pass }} |
- set_fact: etherpad_api_key={{ rand_pass }} |
||||||
when: etherpad_api_key is not defined |
|
||||||
tags: etherpad |
tags: etherpad |
||||||
|
|
||||||
- import_tasks: ../includes/get_rand_pass.yml |
- when: etherpad_admin_pass is not defined |
||||||
vars: |
block: |
||||||
- pass_file: "{{etherpad_root_dir }}/meta/ansible_admin_pass" |
- import_tasks: ../includes/get_rand_pass.yml |
||||||
when: etherpad_admin_pass is not defined |
vars: |
||||||
tags: etherpad |
- pass_file: "{{etherpad_root_dir }}/meta/ansible_admin_pass" |
||||||
- set_fact: etherpad_admin_pass={{ rand_pass }} |
- set_fact: etherpad_admin_pass={{ rand_pass }} |
||||||
when: etherpad_admin_pass is not defined |
|
||||||
tags: etherpad |
tags: etherpad |
||||||
|
|
||||||
|
- name: Check if web dir exists |
||||||
|
stat: path={{ etherpad_root_dir }}/web |
||||||
|
register: etherpad_web_dir |
||||||
|
tags: etherpad |
||||||
|
@ -1,7 +1,7 @@ |
|||||||
#!/bin/bash -e |
#!/bin/bash -e |
||||||
|
|
||||||
restorecon -R {{ etherpad_root_dir }} |
restorecon -R {{ etherpad_root_dir }} |
||||||
chown -R {{ etherpad_user }}:{{ etherpad_user }} {{ etherpad_root_dir }}/web |
chown -R {{ etherpad_user }}:{{ etherpad_user }} {{ etherpad_root_dir }}/app |
||||||
find {{ etherpad_root_dir }}/web -type f -exec chmod 644 "{}" \; |
find {{ etherpad_root_dir }}/app -type f -exec chmod 644 "{}" \; |
||||||
find {{ etherpad_root_dir }}/web -type d -exec chmod 755 "{}" \; |
find {{ etherpad_root_dir }}/app -type d -exec chmod 755 "{}" \; |
||||||
chmod 640 {{ etherpad_root_dir }}/web/{settings.json,SESSIONKEY.txt,APIKEY.txt} |
chmod 600 {{ etherpad_root_dir }}/app/{settings.json,SESSIONKEY.txt,APIKEY.txt} |
||||||
|
@ -1,3 +1,3 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
|
|
||||||
rm -f {{ etherpad_root_dir }}/db_dumps/* |
rm -f {{ etherpad_root_dir }}/backup/* |
||||||
|
Loading…
Reference in new issue