Add CLAUDE files. Add upgrade
This commit is contained in:
53
playbooks/upgrade_appwrite.yml
Normal file
53
playbooks/upgrade_appwrite.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
- name: Upgrade Appwrite
|
||||
hosts: bab1.mgmt.toal.ca
|
||||
vars:
|
||||
appwrite_dir: /home/ptoal/appwrite
|
||||
appwrite_socket: /var/run/docker.sock
|
||||
appwrite_web_port: 8080
|
||||
appwrite_websecure_port: 8443
|
||||
# Sequential upgrade path: cannot skip minor versions.
|
||||
upgrade_path:
|
||||
- "1.6.2"
|
||||
- "1.7.4"
|
||||
|
||||
tasks:
|
||||
- name: Get current Appwrite container info
|
||||
community.docker.docker_container_info:
|
||||
name: appwrite
|
||||
register: appwrite_container_info
|
||||
|
||||
- name: Set current Appwrite version fact
|
||||
ansible.builtin.set_fact:
|
||||
current_appwrite_version: >-
|
||||
{{ appwrite_container_info.container.Config.Image.split(':') | last
|
||||
if appwrite_container_info.exists
|
||||
else '0.0.0' }}
|
||||
|
||||
- name: Show current Appwrite version
|
||||
ansible.builtin.debug:
|
||||
msg: "Current Appwrite version: {{ current_appwrite_version }}"
|
||||
|
||||
- name: Back up MariaDB data volume before upgrade
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- docker
|
||||
- run
|
||||
- --rm
|
||||
- --volume
|
||||
- appwrite-mariadb:/data:ro
|
||||
- --volume
|
||||
- "{{ appwrite_dir }}:/backup"
|
||||
- alpine
|
||||
- tar
|
||||
- czf
|
||||
- /backup/mariadb-backup-pre-upgrade.tar.gz
|
||||
- /data
|
||||
changed_when: true
|
||||
|
||||
- name: Upgrade through each intermediate version
|
||||
ansible.builtin.include_tasks: tasks/upgrade_appwrite_step.yml
|
||||
loop: "{{ upgrade_path }}"
|
||||
loop_control:
|
||||
loop_var: appwrite_target_version
|
||||
when: appwrite_target_version is version(current_appwrite_version, '>')
|
||||
Reference in New Issue
Block a user