This commit is contained in:
ahmadbilalkhalid 2019-08-29 17:56:34 +05:00
parent 6066c28ef0
commit b889dfadb4
2 changed files with 9 additions and 9 deletions

View file

@ -11,6 +11,14 @@ def ceph():
@click.option("--ceph_url", required=True)
@click.option("--ssh_username", required=True)
def setup(ceph_url, ssh_username):
ssh_key = ""
with open("~/.ssh/id_rsa.pub") as pubkey:
ssh_key = pubkey.read()
with open("~/.ssh/known_hosts", "a") as known_hosts:
known_hosts.write(f"{ceph_url} {ssh_key}")
os.makedirs("/etc/ceph", exist_ok=True)
command = f"sftp -b ./ceph_batch_cmd {ssh_username}@{ceph_url}:/etc/ceph"
subprocess.check_output(command.split())
subprocess.check_output(command.split())

View file

@ -1,8 +0,0 @@
if [ $# -lt 2 ]; then
echo "arg1: username of ceph host (ssh) e.g root"
echo "arg2: url/ip of ceph host e.g ceph-test.llnu.ungleich.cloud"
exit 1
fi
mkdir -p /etc/ceph
sftp -b ./ceph_batch_cmd $1@$2:/etc/ceph