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.3.tar.gz (16.9 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.3-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rsyncdirector_deploy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 873119a0787446155314f232d6a2ffb19a3f2e3369b4d58be122a932976b61a4
MD5 e9b490e3a93d9e5afefab3a4d58c2af0
BLAKE2b-256 49f1400a2165d9611e95d9be7b8bdc0e1a5625dd89f204d61b78ee3984395361

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rsyncdirector_deploy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9ddf0ab3fe83bb428818fc9187c6cee31de6344db213556394f717f2dfb0becf
MD5 2045653674163311b499cd0f08e0d0e1
BLAKE2b-256 c37ce9974861b22e66ae6bded51d59f0e96b3250e5e0d290b9fcaf499f4d374b

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