Add remote file resource which will download keys

This commit is contained in:
Dmitry Shulyak 2015-10-12 17:57:34 +03:00
parent b407d83941
commit 2d57c49be3
4 changed files with 36 additions and 1 deletions

View File

@ -37,12 +37,18 @@ def deploy():
db.clear()
resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 1})
first_node = next(x for x in resources if x.name.startswith('node'))
ssh = next(x for x in resources if x.name.startswith('ssh'))
library = vr.create('library1', 'resources/fuel_library', {})[0]
first_node.connect(library)
keys = vr.create('ceph_key', 'resources/ceph_keys', {})[0]
remote_file = vr.create('ceph_key2', 'resources/remote_file',
{'dest': '/var/lib/astute/'})[0]
first_node.connect(keys)
keys.connect(remote_file, {'ip': 'remote_ip', 'path': 'remote_path'})
ssh.connect(remote_file,
{'ssh_key': 'remote_key', 'ssh_user': 'remote_user'})
first_node.connect(remote_file)
ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon',
{'storage': STORAGE,

View File

@ -11,4 +11,7 @@ input:
key_name:
schema: str!
value: ceph
path:
schema: str!
value: /var/lib/astute/ceph/
tags: []

View File

@ -0,0 +1,3 @@
mkdir -p {{remote_path}}
scp -i {{remote_key}} -r {{remote_user}}@{{remote_ip}}:/{{remote_path}} {{dest}}

View File

@ -0,0 +1,23 @@
id: remote_file
handler: shell
version: 1.0.0
input:
ip:
schema: str!
value:
remote_ip:
schema: str!
value:
remote_user:
schema: {}
value:
remote_path:
schema: str!
value:
remote_key:
schema: str!
value:
dest:
schema: str!
value:
tags: []