Skip to content

Instantly share code, notes, and snippets.

@ccamacho

ccamacho/rear.sh Secret

Last active September 3, 2019 11:08
Show Gist options
  • Save ccamacho/108bca152d406d27fa5410f01effc882 to your computer and use it in GitHub Desktop.
Save ccamacho/108bca152d406d27fa5410f01effc882 to your computer and use it in GitHub Desktop.
Run ReaR
cd
git clone https://github.com/openstack/tripleo-ansible
cd ~/tripleo-ansible
git review -d 678864
cd
tripleo-ansible-inventory \
--ansible_ssh_user heat-admin \
--static-yaml-inventory ~/tripleo-inventory.yaml
# For this backup configuration we asume the following:
# We will create the backup of the control plane nodes only.
# We will use the Undercloud node as the NFS server.
# We handle the Undercloud backup as a separate process.
# Playbook
# We will setup the NFS node in the Undercloud
# (we don't have any other place at the moment to do this)
cat <<'EOF' > ~/bar_nfs_setup.yaml
- become: true
hosts: undercloud
name: Setup NFS server for ReaR
roles:
- role: backup-and-restore
EOF
# Playbook
# We install and configure ReaR in the control plane nodes
# As they are the only nodes we will like to backup now.
cat <<'EOF' > ~/bar_rear_setup.yaml
- become: true
hosts: ['controller-0', 'controller-1', 'controller-2']
name: Setup NFS server for ReaR
roles:
- role: backup-and-restore
EOF
# Playbook
# We run ReaR in the control plane ndoes.
cat <<'EOF' > ~/bar_rear_create_restore_images.yaml
- become: true
hosts: ['controller-0', 'controller-1', 'controller-2']
name: Create the recovery images for the control plane
roles:
- role: backup-and-restore
EOF
# We mount the tripleo-ansible folder in the home
# folder (local testing only)
cd
ln -s ~/tripleo-ansible/roles roles
# Configure NFS server in the Undercloud node
ansible-playbook \
-v -i ~/tripleo-inventory.yaml \
--become \
--become-user root \
--tags bar_setup_nfs_server \
~/bar_nfs_setup.yaml
# Configure ReaR in the control plane
ansible-playbook \
-v -i ~/tripleo-inventory.yaml \
--become \
--become-user root \
--tags bar_setup_rear \
~/bar_rear_setup.yaml
# Create recovery images of the control plane
ansible-playbook \
-v -i ~/tripleo-inventory.yaml \
--become \
--become-user root \
--tags bar_create_recover_image \
~/bar_rear_create_restore_images.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment