Astra Mirroring Setup Using Ansible Playbooks

| This document provides step-by-step instructions for setting up and managing Astra Mirroring using the provided Ansible playbooks.

You can find all the required files in the GitHub repository: Astra Mirroring Playbooks.

Prerequisites

  1. Docker and Docker Compose

    • Ensure Docker is installed on the target machine.

    • Ensure Docker Compose is installed.

    • Refer official Docker docs

  2. Ansible

    • Install Ansible on your control machine

    • Refer official Ansible docs

  3. Access Configuration

    • Ensure you can SSH into the target machine as the desired remote user.

    • Add the target machine to your Ansible inventory (e.g., /etc/ansible/hosts).


Editables and File description

  1. .env (environment variables) | This file contains configuration for the OTEL exporter and retry settings. Edit the following variables as per your requirements:

  1. mirror-settings.json | This JSON file defines the mirroring settings. Edit the following variables:

  1. setup.yaml and upgrade.yaml | These both are playbooks for provisioning the Astra Packet process and also to upgrade it to a latest version Populate the below keys in both playbooks.


Steps to Set Up Astra Mirroring using Ansible

  1. **Access playbooks and config files **

  2. Edit Configuration Files

    • Modify .env and mirror-settings.json with appropriate values.

    • Ensure paths to these files are specified in the setup.yaml and upgrade.yaml playbooks.

  3. Add Target Hosts to Ansible Inventory Add the target hosts in your Ansible inventory file, e.g., hosts: Visit the Ansible docs for instructions and strategies to build your inventory file

[instances]
 ansible_user= ansible_user= ansible_user=
  1. Run the Setup Playbook Run the playbook to set up Astra Mirroring:

ansible-playbook -i /path/to/hosts setup.yaml
  1. Upgrade Astra Mirroring Run the playbook to upgrade the Astra Mirroring container:

ansible-playbook -i /path/to/hosts upgrade.yaml
  1. Remove dangling images of getastra/mirroring

||| Be cautious while using this playbook as it removes docker images of getastra/mirroring using the docker cli and not the Ansible's docker module

ansible-playbook -i /path/to/hosts remove.yaml

Setup manually using docker compose

  1. Access the docker-compose.yaml

    • Click here to get the docker-compose.yaml

  2. Run and Stop the docker-compose.yaml

    • Run: docker-compose up -d

    • Stop: docker-compose down


Notes