Add ceph_keys resource

This commit is contained in:
Dmitry Shulyak 2015-10-09 13:15:23 +03:00
parent 61566b6a66
commit e575e02279
3 changed files with 33 additions and 0 deletions

View File

@ -41,6 +41,8 @@ def deploy():
library = vr.create('library1', 'resources/fuel_library', {})[0] library = vr.create('library1', 'resources/fuel_library', {})[0]
first_node.connect(library) first_node.connect(library)
keys = vr.create('ceph_key', 'resources/ceph_keys', {})[0]
first_node.connect(keys)
# TODO(use library resource) # TODO(use library resource)
# ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon', # ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon',
# {'storage': STORAGE, # {'storage': STORAGE,

View File

@ -0,0 +1,17 @@
#!/bin/sh
BASE_PATH={{ target_directory }}
KEY_NAME={{ key_name }}
function generate_ssh_keys {
local dir_path=$BASE_PATH$KEY_NAME/
local key_path=$dir_path$KEY_NAME
mkdir -p $dir_path
if [ ! -f $key_path ]; then
ssh-keygen -b 2048 -t rsa -N '' -f $key_path 2>&1
else
echo 'Key $key_path already exists'
fi
}
generate_ssh_keys

View File

@ -0,0 +1,14 @@
id: ceph_keys
handler: shell
version: 1.0.0
input:
ip:
schema: str!
value:
target_directory:
schema: str!
value: /var/lib/astute
key_name:
schema: str!
value: ceph
tags: []