From 750dc6da453101acca1c786628ec3b039a6f41f0 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Aug 27 2020 23:30:24 +0000 Subject: Add playbooks to manually backup/restore IPA (stg) This is to be able to restore things to a clean slate when we test the fas2ipa data migration script. Signed-off-by: Nils Philippsen --- diff --git a/playbooks/manual/noggin-deployment/create-full-backup.yml b/playbooks/manual/noggin-deployment/create-full-backup.yml new file mode 100644 index 0000000..75d13fe --- /dev/null +++ b/playbooks/manual/noggin-deployment/create-full-backup.yml @@ -0,0 +1,12 @@ +- name: backup IPA data for testing + hosts: ipa_stg + #vars_files: + # - /srv/web/infra/ansible/vars/global.yml + # - "/srv/private/ansible/vars.yml" + # - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + tasks: + - name: create backup of FreeIPA server data + command: ipa-backup + - name: make the latest backup available under a fixed name + chdir: /var/lib/ipa/backup + shell: ln -snf $(ls -1t ipa-full* | head -n 1) ipa-full-latest diff --git a/playbooks/manual/noggin-deployment/restore-latest-backup.yml b/playbooks/manual/noggin-deployment/restore-latest-backup.yml new file mode 100644 index 0000000..8426b53 --- /dev/null +++ b/playbooks/manual/noggin-deployment/restore-latest-backup.yml @@ -0,0 +1,9 @@ +- name: restore latest IPA backup for testing + hosts: ipa_stg + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + # - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + tasks: + - name: restore latest backup of FreeIPA server data + command: ipa-restore /var/lib/ipa/backup/ipa-full-latest -p {{ ipa_admin_password }}