Update to 2020-12-08 12:00

master
Daniel Berteaud 4 years ago
parent 6be0f6bb32
commit d05125afc1
  1. 3
      roles/squid/files/acl/software_various.domains
  2. 2
      roles/wapt_server/meta/main.yml
  3. 26
      roles/wapt_server/tasks/main.yml
  4. 2
      roles/wapt_server/templates/post-backup.sh.j2
  5. 8
      roles/wapt_server/templates/pre-backup.sh.j2
  6. 7
      roles/wapt_server/vars/CentOS-7.yml
  7. 7
      roles/wapt_server/vars/CentOS-8.yml

@ -328,3 +328,6 @@ download1.rpmfusion.org
# Composer # Composer
getcomposer.org getcomposer.org
# Sentry
downloads.sentry-cdn.com

@ -1,3 +1,5 @@
--- ---
dependencies: dependencies:
- role: repo_wapt - role: repo_wapt
- role: postgresql_server
when: wapt_db_server in ['localhost','127.0.0.1']

@ -1,16 +1,14 @@
--- ---
- name: Install packages - include_vars: "{{ item }}"
yum: with_first_found:
name: - vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml
- tis-waptserver - vars/{{ ansible_distribution }}.yml
- tis-waptsetup - vars/{{ ansible_os_family }}.yml
- postgresql13
- python-psycopg2 # Needed to manage PG with ansible
tags: wapt tags: wapt
- include_tasks: postgresql.yml - name: Install packages
when: wapt_db_server == '127.0.0.1' or wapt_db_server == 'localhost' yum: name={{ wapt_packages }}
tags: wapt tags: wapt
- name: Create directories - name: Create directories
@ -18,6 +16,8 @@
loop: loop:
- path: /opt/wapt/meta - path: /opt/wapt/meta
mode: 700 mode: 700
- path: /opt/wapt/backup
mode: 700
- path: /var/www/html/ssl - path: /var/www/html/ssl
mode: 750 mode: 750
owner: wapt owner: wapt
@ -200,7 +200,7 @@
tags: wapt tags: wapt
- name: Create DB dump directory - name: Create DB dump directory
file: path=/opt/wapt/db_dumps state=directory mode=0700 file: path=/opt/wapt/backup state=directory mode=0700
tags: wapt tags: wapt
- name: Deploy pre and post backup scripts - name: Deploy pre and post backup scripts
@ -209,3 +209,9 @@
- pre - pre
- post - post
tags: wapt tags: wapt
- name: Remove tmp and obsolete files
file: path={{ item }} state=absent
loop:
- /opt/wapt/db_dumps
tags: wapt

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
rm -f /opt/wapt/db_dumps/* rm -f /opt/wapt/backup/*

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
PGPASSWORD='{{ wapt_db_pass }}' /usr/pgsql-11/bin/pg_dump \ PGPASSWORD={{ wapt_db_pass | quote }} /usr/pgsql-13/bin/pg_dump \
--clean \ --clean \
--create \ --create \
--username={{ wapt_db_user }} \ --username={{ wapt_db_user | quote }} \
--host={{ wapt_db_server }} \ --host={{ wapt_db_server | quote }} \
{{ wapt_db_name }} | lz4 -c > /opt/wapt/db_dumps/{{ wapt_db_name }}.sql.lz4 {{ wapt_db_name | quote }} | zstd -c > /opt/wapt/backup/{{ wapt_db_name }}.sql.zst

@ -0,0 +1,7 @@
---
wapt_packages:
- tis-waptserver
- tis-waptsetup
- postgresql13
- python-psycopg2 # Needed to manage PG with ansible

@ -0,0 +1,7 @@
---
wapt_packages:
- tis-waptserver
# - tis-waptsetup
- postgresql13
- python3-psycopg2 # Needed to manage PG with ansible
Loading…
Cancel
Save