meza
meza copied to clipboard
Make it possible to modify wiki ID
Random notes for how to move a wiki to a new ID (also changes URL). Note that it's more complicated if the wiki is the primary wiki and if you want to avoid outages.
# FIXME: take input from user
# Perform checks on user input
# FIXME #179: This isn't working: spaces and dashes getting through
# FIXME #298: Dashes break MariaDB. Figure out how to allow them.
- assert:
that: 'wiki_id is search("[a-zA-Z0-9_]")'
msg: "Your wiki ID may only include letters, numbers and underscores"
# FIXME:
# IF this is primary wiki:
# make all wikis read only
# ELSE:
# make old_wiki_id read-only
- name: Remove any existing database dumps
file:
path: "{{ m_tmp }}/{{ env }}_{{ old_wiki_id }}.sql"
state: absent
delegate to MASTER
- name: Dump wiki {{ old_wiki_id }} database
mysql_db:
state: dump
name: "wiki_{{ old_wiki_id }}"
target: "{{ m_tmp }}/{{ env }}_{{ old_wiki_id }}.sql"
delegate to MASTER
# FIXME: import dump to new_wiki_id on MASTER
# Make option to move, not copy?
- name: Copy uploads from OLD to NEW
MOVE:
src: "{{ m_uploads_dir }}/{{ old_wiki_id }}"
dest: "{{ m_uploads_dir }}/{{ new_wiki_id }}"
# FIXME: Move config "{{ m_local_public }}/wikis/{{ old_wiki_id }}" to
# "{{ m_local_public }}/wikis/{{ new_wiki_id }}"
# FIXME: Make "$m_htdocs/wikis" match {{ m_local_public }}/wikis
# Do a portion of deploy? Do a portion of create-wiki?
# FIXME: /opt/conf-meza/public --> /opt/.deploy-meza/public
# FIXME: If old is primary wiki, update primary wiki in public.yml
# FIXME: "primary_wiki_id: fod --> primary_wiki_id: general"
# FIXME: deploy localsettings
# FIXME: deploy blendersettings
# FIXME: drop old_wiki_id on MASTER
# FIXME: from create-wiki-wrapper (all of the following):
# Required to fix scope of wiki_id variable when set via prompt. Ref #954.
- name: Set fact - wiki_id
set_fact:
wiki_id: "{{ wiki_id }}"
- name: Sync configurations (FIXME do we need this)
include_role:
name: sync-configs
- name: Add wiki to configuration
include_role:
name: configure-wiki
- name: Re-sync config to app servers
include_role:
name: sync-configs
- name: Use verify-wiki to make sure new wiki is setup
include_role:
name: verify-wiki