diff --git a/examples/library_ceph/ceph.py b/examples/library_ceph/ceph.py index b6a0e579..2529c335 100644 --- a/examples/library_ceph/ceph.py +++ b/examples/library_ceph/ceph.py @@ -35,20 +35,22 @@ 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')) - ssh = next(x for x in resources if x.name.startswith('ssh')) + 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) 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] - first_node.connect(keys) + second_node.connect(remote_file) 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) + first_transp.connect(remote_file, {'transports': 'remote'}) + ceph_mon = vr.create('ceph_mon1', 'resources/ceph_mon', {'storage': STORAGE, diff --git a/resources/remote_file/actions/run.sh b/resources/remote_file/actions/run.sh index cb2cb39e..212bdfb4 100644 --- a/resources/remote_file/actions/run.sh +++ b/resources/remote_file/actions/run.sh @@ -1,3 +1,10 @@ -mkdir -p {{remote_path}} +mkdir -p {{dest}} -scp -i {{remote_key}} -r {{remote_user}}@{{remote_ip}}:/{{remote_path}} {{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 diff --git a/resources/remote_file/meta.yaml b/resources/remote_file/meta.yaml index 1b4bed9f..6e319bdb 100644 --- a/resources/remote_file/meta.yaml +++ b/resources/remote_file/meta.yaml @@ -5,18 +5,15 @@ input: ip: schema: str! value: + remote: + schema: {} + value: remote_ip: schema: str! value: - remote_user: - schema: {} - value: remote_path: schema: str! value: - remote_key: - schema: str! - value: dest: schema: str! value: