a
This commit is contained in:
parent
c2c32fe0f1
commit
a2605ba3d2
4 changed files with 171 additions and 5 deletions
28
app/ceph.py
Normal file
28
app/ceph.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import click
|
||||
import subprocess
|
||||
import os
|
||||
import shutil
|
||||
import pysftp
|
||||
|
||||
from app.helper import (
|
||||
clone,
|
||||
clone_common,
|
||||
clone_etcd_wrapper,
|
||||
GitOperation,
|
||||
PipenvOperation,
|
||||
FileOperation,
|
||||
)
|
||||
|
||||
|
||||
@click.group()
|
||||
def host():
|
||||
pass
|
||||
|
||||
|
||||
@host.command("setup")
|
||||
@click.option("--ceph_url", required=True)
|
||||
@click.option("--ssh_username", required=True)
|
||||
@click.option("--ssh_key_path", required=True, help="For Example, ~/.ssh/id_rsa")
|
||||
def setup(ceph_url, ssh_username, ssh_key_path):
|
||||
with pysftp.Connection(host=ceph_url, username=ssh_username, private_key=ssh_key_path) as sftp:
|
||||
sftp.get_r('/etc/ceph', '/etc/ceph', preserve_mtime=True)
|
||||
Loading…
Add table
Add a link
Reference in a new issue