Run Ansible Backup Playbook RemotelyΒΆ

In this method you can run Ansible Backup playbook on a remote workstation and target it at controller-0.

Prerequisites

  • You need to have Ansible installed on your remote workstation, along with the Ansible Backup/Restore playbooks.

  • Your network has IPv6 connectivity before running Ansible Playbook, if the system configuration is IPv6.

Procedure

  1. Log in to the remote workstation.

  2. Create secret and backup folders.

    For example:

    cd $HOME
    mkdir -p <br> <overrides>
    
  3. Provide either a customized Ansible hosts file specified using the -i option, or use the default one in the Ansible configuration directory (that is, /etc/ansible/hosts).

    1. If using a customized file, change to the <br> directory created in the previous step.

    2. Make the following modifications. You must specify the floating OAM IP of the controller host and the ansible_ssh_user information. If the host name is stx_Cluster, the inventory file should have an entry stx_Cluster.

      For example:

      ---
      all:
        hosts:
          wc68:
            ansible_host: 128.222.100.02
          stx_Cluster:
            ansible_host: 128.224.141.74
      
        vars:
          ansible_ssh_user: sysadmin
          ansible_ssh_pass: <sysadmin-passwd>
          ansible_become_pass: <sysadmin-passwd>
  4. Switch to the <overrides> directory created previously.

  5. Create a new secret file encrypted with Ansible-Vault using the ansible-vault create $HOME/override_dir/secrets.yml command.

    Set and confirm a new Ansible-Vault password. Ansible will open an editing window where you can enter your desired contents.

    The following settings are usually common to all hosts, in which case they can be placed in the secrets.yml file.

    vault_password_change_responses:
        yes/no: 'yes'
        sysadmin*: 'sysadmin'
        (current) UNIX password: 'sysadmin'
        New password: 'St8rlingX*'
        Retype new password: 'St8rlingX*'
    admin_password: St8rlingX*
    ansible_become_pass: St8rlingX*
    ansible_ssh_pass: St8rlingX*
    

    Save your changes and quit the editor. If you need to make additional changes, you can use the command ansible-vault edit $HOME/override_dir/secrets.yml.

  6. Run Ansible Backup playbook:

    ~(keystone_admin)]$ ansible-playbook <path-to-backup-playbook-entry-file> -ask-vault-pass -e "host_backup_dir=$HOME/br_test override_files_dir=$HOME/override_dir"
    

    For example:

    ~(keystone_admin)]$ ansible-playbook backup.yml --limit sm5 -i $HOME/br_test/hosts --ask-vault-pass -e "host_backup_dir=$HOME/br_test override_files_dir=$HOME/override_dir"
    

    The generated backup tar file can be found in <host_backup_dir>, that is, /home/sysadmin, by default. You can overwrite it using the -e option on the command line or in an override file.

    Warning

    If a backup of the local registry images file is created, the file is not copied from the remote machine to the local machine. The inventory_hostname_docker_local_registry_backup_timestamp.tgz file needs to copied off the host machine to be used if a restore is needed.