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
-
Ensure that there is a compatible version of Python installed. See
pyproject.tomlfor details. -
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
-
Build
pip install -r ./requirements_dev.txt && \ python -m build && \ twine check dist/* -
Install the wheel file
pip install ./dist/rsyncdirector_deploy-<version>-py3-none-any.whl -
Run
rsyncdirector_deploy -hto 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.
- Distribute public SSH keys for the user under which you will run the deployment program on your localhost to the
rootuser on the hosts on which you want to installrsyncdirector.
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.
-
Create an
rsyncdirector.yamlconfig file to define the data that you want torsync. See thersyncdirector.yamlfile for a complete example with explanation. -
Install Python on the target host:
rsyncdirector_deploy python -h -
Install
rsyncdirectorconfigs on the target host and optionally create anrsyncdirectoruser under which the application will run. The user under whichrsyncdirectorruns MUST have read access to all data to bersynced. In many cases, this can just be therootuser 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 -
Install the
rsyncdirectorapplicationrsyncdirector_deploy rsyncdirector install -h -
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
rsyncdirectorwill 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
rsyncdirectorconfiguration that connects using that user.For example: in order to be able to read any files on the source host, run the
rsyncdirectoras root. On the remote host to which data is to be synced create abackupuser and create a directory where thebackupusers hasr-w-xpermissions. Create an ssh key-pair for therootuser on the localhost and distribute the public key to the remote host adding it to thebackupuser'sauthorized_keysfile.
Development
Do the following if you want to develop and debug the installation scripts using VSCode.
- Create a virtual environment as described in the Setup section above.
- Pip install the additional
requirements_dev.txtdependencies. - Add the
deploymentdirectory to VSCode. - Click on the Debug tab and select from one of the launch configuratons defined in the
launch.jsonfile. You must have themain.pyfile 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rsyncdirector_deploy-0.0.2.tar.gz.
File metadata
- Download URL: rsyncdirector_deploy-0.0.2.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
924f53302a2fe8ca22b086f141cb333727abc2a23dfefe9d9c0f68cec323705a
|
|
| MD5 |
36f698739746c1959296fdeb3bdd6011
|
|
| BLAKE2b-256 |
47041faf05a7e7503b75c0c2b45a0d2e49201e7ef315a7f7e43a47ffa48198a9
|
File details
Details for the file rsyncdirector_deploy-0.0.2-py3-none-any.whl.
File metadata
- Download URL: rsyncdirector_deploy-0.0.2-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e632f63a7b0b9f0f3fa8199ce23d2557ba192bf6f1028d271a210aaca97350
|
|
| MD5 |
af631f860c8963caec9c2a8a1f709dcc
|
|
| BLAKE2b-256 |
49f11e834c8a1706dbce957fa4c18997706408e3cdae5e66d96e35917a70ae8c
|