Skip to main content

Deployment tools for the rsyncdirector module

Project description

RsyncDirector Deployment

A command line program for automating the deployment of rsyncdirector instances.

Install RsyncDirector Deployment

Create a Virtual Environment

  1. Ensure that there is a compatible version of Python installed. See pyproject.toml for details.

  2. Export the path to the Python interpreter and the path to the virtenv and create and source the virtenv.

    export PYTHON_PATH=<path-to-your-interpreter>
    export VIRT_ENV_PATH=<path-to-virt-env-parent-dir>
    $PYTHON_PATH -mvenv $VIRT_ENV_PATH
    . $VIRT_ENV_PATH/bin/activate
    

Install install from PyPi or build and install from the .whl file.

From PyPi

pip install rsyncdirector_deploy

Build and Install from Wheel

  1. Build

    pip install -r ./requirements_dev.txt && \
    python -m build && \
    twine check dist/*
    
  2. Install the wheel file

    pip install ./dist/rsyncdirector_deploy-<version>-py3-none-any.whl
    
  3. Run rsyncdirector_deploy -h to confirm installation and to see details on how to run it.

Distribute SSH Keys

The rsyncdirector_deploy program uses the Python Fabric library which depends on the Python Paramiko library for the core SSH protocol implementation to run commands on the remote hosts over SSH. SSH connections are currently authenticated using passphrase-less SSH keys.

  1. Distribute public SSH keys for the user under which you will run the deployment program on your localhost to the root user on the hosts on which you want to install rsyncdirector.

Using the Deployment Tool to Install RsyncDirector

Following is an outline of the operations and commands required to run rynscdirector. The rsyncdirector_deployment tool automates all of the following operations except the distribution of keys.

  1. Create an rsyncdirector.yaml config file to define the data that you want to rsync. See the rsyncdirector.yaml file for a complete example with explanation.

  2. Install Python on the target host:

    rsyncdirector_deploy python -h
    
  3. Install rsyncdirector configs on the target host and optionally create an rsyncdirector user under which the application will run. The user under which rsyncdirector runs MUST have read access to all data to be rsynced. In many cases, this can just be the root user to avoid having to create an additional user and ensure that the user has read access to all of the source data.

    rsyncdirector_deploy rsyncdirector configs -h
    
  4. Install the rsyncdirector application

    rsyncdirector_deploy rsyncdirector install -h
    
  5. Distribute SSH keys for the aforementioned user to the remote host(s) to which you will be syncing data Create ssh key pairs for the aforementioned user under which the rsyncdirector will run and distribute the public keys to the users on the remote hosts to which you will be syncing data.

    Best practice is to create a non-root user on the remote host to which data will be synced and then have create an rsyncdirector configuration that connects using that user.

    For example: in order to be able to read any files on the source host, run the rsyncdirector as root. On the remote host to which data is to be synced create a backup user and create a directory where the backup users has r-w-x permissions. Create an ssh key-pair for the root user on the localhost and distribute the public key to the remote host adding it to the backup user's authorized_keys file.

Development

Do the following if you want to develop and debug the installation scripts using VSCode.

  1. Create a virtual environment as described in the Setup section above.
  2. Pip install the additional requirements_dev.txt dependencies.
  3. Add the deployment directory to VSCode.
  4. Click on the Debug tab and select from one of the launch configuratons defined in the launch.json file. You must have the main.py file selected in the IDE before clicking on the Debug play button.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rsyncdirector_deploy-0.0.1.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rsyncdirector_deploy-0.0.1-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file rsyncdirector_deploy-0.0.1.tar.gz.

File metadata

  • Download URL: rsyncdirector_deploy-0.0.1.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for rsyncdirector_deploy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 68e0475d0bd4584cb7d0335c23d2d3af11a4a47092f4cd7dc3fe04bcceab9193
MD5 8150635c4347432757a5873cca78e840
BLAKE2b-256 02f7997b84ece7a81a6c054b2f6d6bd332631315525a1fa1ac2235dcbac194f3

See more details on using hashes here.

File details

Details for the file rsyncdirector_deploy-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rsyncdirector_deploy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5121b47b71309e39be2a09ffc6ca44a9de3af589b331e8fc1966da334c910d0
MD5 6a760f1a190da14d468fc09565fc724b
BLAKE2b-256 784aa78f027f959a50d4b05bbdc0ea4425e93b3ecf2369e4b67761669ed4694d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page