Add ceph_keys resource
This commit is contained in:
		| @@ -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, | ||||||
|   | |||||||
							
								
								
									
										17
									
								
								resources/ceph_keys/actions/run.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								resources/ceph_keys/actions/run.sh
									
									
									
									
									
										Normal 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 | ||||||
							
								
								
									
										14
									
								
								resources/ceph_keys/meta.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								resources/ceph_keys/meta.yaml
									
									
									
									
									
										Normal 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: [] | ||||||
		Reference in New Issue
	
	Block a user
	 Dmitry Shulyak
					Dmitry Shulyak