Merge pull request #255 from dshulyak/remote_file

Remote file
This commit is contained in:
Jędrzej Nowak 2015-10-20 17:24:10 +02:00
commit f087a75e6c
4 changed files with 43 additions and 2 deletions

View File

@ -35,8 +35,9 @@ NETWORK_METADATA = yaml.load("""
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'))
resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 2})
first_node, second_node = [x for x in resources if x.name.startswith('node')]
first_transp = next(x for x in resources if x.name.startswith('transport'))
library = vr.create('library1', 'resources/fuel_library', {})[0]
first_node.connect(library)
@ -44,6 +45,13 @@ def deploy():
keys = vr.create('ceph_key', 'resources/ceph_keys', {})[0]
first_node.connect(keys)
remote_file = vr.create('ceph_key2', 'resources/remote_file',
{'dest': '/var/lib/astute/'})[0]
second_node.connect(remote_file)
keys.connect(remote_file, {'ip': 'remote_ip', 'path': 'remote_path'})
first_transp.connect(remote_file, {'transports': 'remote'})
ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon',
{'storage': STORAGE,
'keystone': KEYSTONE,

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,10 @@
mkdir -p {{dest}}
{% for transport in remote %}
{% if transport.name == 'ssh' %}
scp -i {{transport.key}} -r {{transport.user}}@{{remote_ip}}:/{{remote_path}} {{dest}}
exit 0
{% endif %}
{% endfor %}
echo 'No suitable transport.'
exit 2

View File

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